code: def testTensorFlowGraph(self):
      tf_graph = tf.Graph()
      with tf_graph.as_default():
          with tf.device("/device:CPU:0"):
              x = tf.zeros([3, 4], dtype=tf.int32, name="X")
              y = tf.zeros([4, 5], dtype=tf.int32, name="Y")
              tf.matmul(x, y, name="Z1")
              tf.matmul(x, y, name="Z2")
  
      graph = graph_interface.GraphInterface(
          tf_graph, canonical_device="/device:CPU:0"
      )
      self.VerifyGraphInterface(graph)
  
      self.assertCountEqual(
          graph.get_operation_mtf_dimension_names("X"), []
      )
      self.assertCountEqual(
          graph.get_operation_mtf_dimension_names("Y"), []
      )
      self.assertCountEqual(
          graph.get_operation_mtf_dimension_names("Z1"), []
      )
      self.assertCountEqual(
          graph.get_operation_mtf_dimension_names("Z2"), []
      )
  
      self.assertCountEqual(
          graph.get_tensor_mtf_dimension_names("X:0"), []
      )
      self.assertCountEqual(
          graph.get_tensor_mtf_dimension_names("Y:0"), []
      )
      self.assertCountEqual(
          graph.get_tensor_mtf_dimension_names("Z1:0"), []
      )
      self.assertCountEqual(
          graph.get_tensor_mtf_dimension_names("Z2:0"), []
      )
  
      self.assertEqual(graph.get_tensor_device("X:0"), "/device:CPU:0")
      self.assertEqual(graph.get_tensor_device("Y:0"), "/device:CPU:0")
      self.assertEqual(graph.get_tensor_device("Z1:0"), "/device:CPU:0")
      self.assertEqual(graph.get_tensor_device("Z2:0"), "/device:CPU: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._cost_graph_string,
      )
      self.assertEqual(
          graph.compute_cost_graph(
              devices=["/device:CPU:0"]
          ).SerializeToString(),
          self._cost_graph_string,
      )
      self.assertEqual(
          graph.compute_cost_graph(devices=[]).SerializeToString(),
          self._sizeless_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 4 for calling the GraphInterfaceTest obj's underlying member method code with example usage: obj.testTensorFlowGraph() without return types