parameters: (if_node: Node)
docstring: Update types for If output ports.
  
          :param if_node: The If node to update output ports and types
          :return: None
docstring_summary: Update types for If output ports.
docstring_tokens: Update types for If output ports .
function: def update_if_output_ports_type(if_node: Node):
          """
          Update types for If output ports.
  
          :param if_node: The If node to update output ports and types
          :return: None
          """
          then_outputs = [node for node in if_node.then_graph.get_op_nodes() if node.has('output_id')]
          else_outputs = [node for node in if_node.else_graph.get_op_nodes() if node.has('output_id')]
          outputs_mapping = {}
          outputs_number = len(if_node.out_ports())
          assert outputs_number == len(then_outputs), 'Incorrect number outputs in then_graph of If with ' \
                                                      'name {0}! then_graph must has {1} outputs' \
              .format(if_node.name, outputs_number)
          assert outputs_number == len(else_outputs), 'Incorrect number outputs in else_graph of If with ' \
                                                      'name {0}! else_graph must has {1} outputs' \
              .format(if_node.name, outputs_number)
          for port_id in if_node.out_ports().keys():
              outputs_mapping[port_id] = {}
          port_ids = outputs_mapping.keys()
          for then_output_node in then_outputs:
              assert then_output_node.soft_get('type') == 'Result'
              port_id = then_output_node['output_id']
              assert port_id in port_ids, 'Incorrect mapping then_graph outputs with {0} outputs! ' \
                                          'Can\'t find port with ID {1} in If operation.' \
                  .format(then_output_node.name, port_id)
              outputs_mapping[port_id]['then_graph'] = then_output_node
  
          for else_output_node in else_outputs:
              assert else_output_node.soft_get('type') == 'Result'
              port_id = else_output_node['output_id']
              assert port_id in port_ids, 'Incorrect mapping then_graph outputs with {0} outputs! ' \
                                          'Can\'t find port with ID {1} in If operation.' \
                  .format(else_output_node.name, port_id)
              outputs_mapping[port_id]['else_graph'] = else_output_node
  
          for port_id in outputs_mapping:
              then_else_nodes = outputs_mapping[port_id]
              assert 'then_graph' in then_else_nodes.keys(), 'then_graph does not connect with If.out_port[{0}] ' \
                                                             'in {1} node!'.format(port_id, if_node.name)
              assert 'else_graph' in then_else_nodes.keys(), 'else_graph does not connect with If.out_port[{0}] ' \
                                                             'in {1} node!'.format(port_id, if_node.name)
              then_type = then_else_nodes['then_graph'].in_port(0).get_data_type()
              else_type = then_else_nodes['else_graph'].in_port(0).get_data_type()
              assert then_type == else_type, 'Cannot get type for if.out_port[{0}]! ' \
                                             'Types in then_graph and else_graph are not equal!'.format(port_id)
              if_node.out_port(port_id).set_data_type(then_type)
function_tokens: def update_if_output_ports_type ( if_node : Node ) : then_outputs = [ node for node in if_node . then_graph . get_op_nodes ( ) if node . has ( 'output_id' ) ] else_outputs = [ node for node in if_node . else_graph . get_op_nodes ( ) if node . has ( 'output_id' ) ] outputs_mapping = { } outputs_number = len ( if_node . out_ports ( ) ) assert outputs_number == len ( then_outputs ) , 'Incorrect number outputs in then_graph of If with ' 'name {0}! then_graph must has {1} outputs' . format ( if_node . name , outputs_number ) assert outputs_number == len ( else_outputs ) , 'Incorrect number outputs in else_graph of If with ' 'name {0}! else_graph must has {1} outputs' . format ( if_node . name , outputs_number ) for port_id in if_node . out_ports ( ) . keys ( ) : outputs_mapping [ port_id ] = { } port_ids = outputs_mapping . keys ( ) for then_output_node in then_outputs : assert then_output_node . soft_get ( 'type' ) == 'Result' port_id = then_output_node [ 'output_id' ] assert port_id in port_ids , 'Incorrect mapping then_graph outputs with {0} outputs! ' 'Can\'t find port with ID {1} in If operation.' . format ( then_output_node . name , port_id ) outputs_mapping [ port_id ] [ 'then_graph' ] = then_output_node for else_output_node in else_outputs : assert else_output_node . soft_get ( 'type' ) == 'Result' port_id = else_output_node [ 'output_id' ] assert port_id in port_ids , 'Incorrect mapping then_graph outputs with {0} outputs! ' 'Can\'t find port with ID {1} in If operation.' . format ( else_output_node . name , port_id ) outputs_mapping [ port_id ] [ 'else_graph' ] = else_output_node for port_id in outputs_mapping : then_else_nodes = outputs_mapping [ port_id ] assert 'then_graph' in then_else_nodes . keys ( ) , 'then_graph does not connect with If.out_port[{0}] ' 'in {1} node!' . format ( port_id , if_node . name ) assert 'else_graph' in then_else_nodes . keys ( ) , 'else_graph does not connect with If.out_port[{0}] ' 'in {1} node!' . format ( port_id , if_node . name ) then_type = then_else_nodes [ 'then_graph' ] . in_port ( 0 ) . get_data_type ( ) else_type = then_else_nodes [ 'else_graph' ] . in_port ( 0 ) . get_data_type ( ) assert then_type == else_type , 'Cannot get type for if.out_port[{0}]! ' 'Types in then_graph and else_graph are not equal!' . format ( port_id ) if_node . out_port ( port_id ) . set_data_type ( then_type )