class_docstr: tf.Graph & mtf.Graph common representation which produces a CostGraphDef.
  
  Attributes:
    canonical_device: string or None, the name of the canonical device for
        is_tensor_on_canonical_device
  
  Usage Example:
    mtf_graph = mtf.Graph()
    # Add operations to mtf_graph using Mesh TensorFlow.
    graph = graph_interface.GraphInterface(mtf_graph)
    for operation_name in graph.get_all_operation_names():
      print("Operation: {}".format(operation_name))
      for input_name in graph.get_operation_input_names(operation_name):
        print("  Input: {}".format(input_name))
      for output_name in graph.get_operation_output_names(operation_name):
        print("  Output: {}".format(output_name))
        # Tensor names can also be used to retrieve data type, shape, and Mesh
        # TensorFlow dimension names.
      # Operation names can also be used to get Mesh TensorFlow dimension names.
    cost_graph = graph.compute_cost_graph()
    # Give cost_graph to a scheduler to compute schedule.
    memory_contents = graph.compute_memory_contents_under_schedule(schedule)
class_docstr_tok: ["tf.Graph","&","mtf.Graph","common","representation","which","produces","a","CostGraphDef",".","Attributes",":","canonical_device",":","string","or","None",",","the","name","of","the","canonical","device","for","is_tensor_on_canonical_device","Usage","Example",":","mtf_graph","=","mtf.Graph","(",")","#","Add","operations","to","mtf_graph","using","Mesh","TensorFlow",".","graph","=","graph_interface.GraphInterface","(","mtf_graph",")","for","operation_name","in","graph.get_all_operation_names","(",")",":","print","(","``","Operation",":","{","}","''",".format","(","operation_name",")",")","for","input_name","in","graph.get_operation_input_names","(","operation_name",")",":","print","(","``","Input",":","{","}","''",".format","(","input_name",")",")","for","output_name","in","graph.get_operation_output_names","(","operation_name",")",":","print","(","``","Output",":","{","}","''",".format","(","output_name",")",")","#","Tensor","names","can","also","be","used","to","retrieve","data","type",",","shape",",","and","Mesh","#","TensorFlow","dimension","names",".","#","Operation","names","can","also","be","used","to","get","Mesh","TensorFlow","dimension","names",".","cost_graph","=","graph.compute_cost_graph","(",")","#","Give","cost_graph","to","a","scheduler","to","compute","schedule",".","memory_contents","=","graph.compute_memory_contents_under_schedule","(","schedule",")"]
docstr: Initializer for _tensor_name_to_ids.
  
  Returns:
    a {string: (int, int)}, mapping the name of tensor T to the index of T's
        operation in _operations and T's index in T's operation's outputs.
docstr_tok: ["Initializer","for","_tensor_name_to_ids",".","Returns",":","a","{","string",":","(","int",",","int",")","}",",","mapping","the","name","of","tensor","T","to","the","index","of","T's","operation","in","_operations","and","T","'s","index","in","T","'s","operation","'s","outputs","."]
code: def _initialize_tensor_name_to_ids(self):
      """Initializer for _tensor_name_to_ids.
  
      Returns:
        a {string: (int, int)}, mapping the name of tensor T to the index of T's
            operation in _operations and T's index in T's operation's outputs.
      """
      tensor_name_to_ids = {}
      for i, operation in enumerate(self._operations):
          for j, tensor in enumerate(operation.outputs):
              tensor_name_to_ids[tensor.name] = (i, j)
      return tensor_name_to_ids
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import math
  import mesh_tensorflow
  import tensorflow.compat.v1
  from tensorflow.core.framework import cost_graph_pb2
label_desc: Use image node_id 22 for calling the GraphInterface obj's underlying member method code with example usage: obj._initialize_tensor_name_to_ids() and returns: tensor_name_to_ids