code: def testMeshTensorFlowGraph(self):
      mtf_graph = mtf.Graph()
      mesh = mtf.Mesh(mtf_graph, "my_mesh")
      x = mtf.Constant(
          mesh,
          0,
          shape=mtf.convert_to_shape("a:3,b:4"),
          dtype=tf.int32,
          name="X",
      ).outputs[0]
      y = mtf.Constant(
          mesh,
          0,
          shape=mtf.convert_to_shape("b:4,c:5"),
          dtype=tf.int32,
          name="Y",
      ).outputs[0]
      mtf.EinsumOperation(
          [x, y], mtf.convert_to_shape("a:3,c:5"), name="Z1"
      )
      mtf.EinsumOperation(
          [x, y], mtf.convert_to_shape("a:3,c:5"), name="Z2"
      )
  
      graph = graph_interface.GraphInterface(mtf_graph)
      self.VerifyGraphInterface(graph)
  
      self.assertCountEqual(
          graph.get_operation_mtf_dimension_names("X"), ["a", "b"]
      )
      self.assertCountEqual(
          graph.get_operation_mtf_dimension_names("Y"), ["b", "c"]
      )
      self.assertCountEqual(
          graph.get_operation_mtf_dimension_names("Z1"), ["a", "b", "c"]
      )
      self.assertCountEqual(
          graph.get_operation_mtf_dimension_names("Z2"), ["a", "b", "c"]
      )
  
      self.assertCountEqual(
          graph.get_tensor_mtf_dimension_names("X:0"), ["a", "b"]
      )
      self.assertCountEqual(
          graph.get_tensor_mtf_dimension_names("Y:0"), ["b", "c"]
      )
      self.assertCountEqual(
          graph.get_tensor_mtf_dimension_names("Z1:0"), ["a", "c"]
      )
      self.assertCountEqual(
          graph.get_tensor_mtf_dimension_names("Z1:0"), ["a", "c"]
      )
  
      self.assertIsNone(graph.get_tensor_device("X:0"))
      self.assertIsNone(graph.get_tensor_device("Y:0"))
      self.assertIsNone(graph.get_tensor_device("Z1:0"))
      self.assertIsNone(graph.get_tensor_device("Z2:0"))
  
      self.assertTrue(graph.is_tensor_on_canonical_device("X:0"))
      self.assertTrue(graph.is_tensor_on_canonical_device("Y:0"))
      self.assertTrue(graph.is_tensor_on_canonical_device("Z1:0"))
      self.assertTrue(graph.is_tensor_on_canonical_device("Z2:0"))
  
      self.assertEqual(
          graph.compute_cost_graph().SerializeToString(),
          self._deviceless_cost_graph_string,
      )
      self.assertEqual(
          graph.compute_cost_graph(devices=[]).SerializeToString(),
          self._deviceless_cost_graph_string,
      )
  
file_path: mesh/mesh_tensorflow/auto_mtf/graph_interface_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import mesh_tensorflow
  from mesh_tensorflow.auto_mtf import graph_interface
  import tensorflow.compat.v1
  from tensorflow.core.framework import cost_graph_pb2
  from tensorflow.core.framework import tensor_shape_pb2
  from tensorflow.core.framework import types_pb2
label_desc: Use image node_id 5 for calling the GraphInterfaceTest obj's underlying member method code with example usage: obj.testMeshTensorFlowGraph() without return types