parameters: (graph: Graph, ports_type='in')
return_statement: return mapping
docstring: Create mapping from (internal_layer_id, internal_port_id) to layer id in body of TensorIterator.
docstring_summary: Create mapping from (internal_layer_id, internal_port_id) to layer id in body of TensorIterator.
docstring_tokens: Create mapping from ( internal_layer_id internal_port_id ) to layer id in body of TensorIterator .
function: def _get_internal_idxs_to_names_dict(graph: Graph, ports_type='in'):
      """
      Create mapping from (internal_layer_id, internal_port_id) to layer id in body of TensorIterator.
      """
      mapping = {}
      ordered_nodes = graph.pseudo_topological_sort()
      for node in ordered_nodes:
          if node.kind == 'op' and node.has_valid('internal_layer_id'):
              mapping[node.internal_layer_id] = node.id
      return mapping
function_tokens: def _get_internal_idxs_to_names_dict ( graph : Graph , ports_type = 'in' ) : mapping = { } ordered_nodes = graph . pseudo_topological_sort ( ) for node in ordered_nodes : if node . kind == 'op' and node . has_valid ( 'internal_layer_id' ) : mapping [ node . internal_layer_id ] = node . id return mapping