code: def VerifyGraphInterface(self, graph):
      self.assertEqual(
          list(graph.get_all_operation_names()), ["X", "Y", "Z1", "Z2"]
      )
  
      self.assertEqual(list(graph.get_operation_input_names("X")), [])
      self.assertEqual(list(graph.get_operation_input_names("Y")), [])
      self.assertEqual(
          list(graph.get_operation_input_names("Z1")), ["X:0", "Y:0"]
      )
      self.assertEqual(
          list(graph.get_operation_input_names("Z2")), ["X:0", "Y:0"]
      )
  
      self.assertEqual(
          list(graph.get_operation_output_names("X")), ["X:0"]
      )
      self.assertEqual(
          list(graph.get_operation_output_names("Y")), ["Y:0"]
      )
      self.assertEqual(
          list(graph.get_operation_output_names("Z1")), ["Z1:0"]
      )
      self.assertEqual(
          list(graph.get_operation_output_names("Z2")), ["Z2:0"]
      )
  
      self.assertEqual(
          list(graph.get_all_tensor_names()),
          ["X:0", "Y:0", "Z1:0", "Z2:0"],
      )
  
      self.assertEqual(graph.get_tensor_dtype("X:0"), tf.int32)
      self.assertEqual(graph.get_tensor_dtype("Y:0"), tf.int32)
      self.assertEqual(graph.get_tensor_dtype("Z1:0"), tf.int32)
      self.assertEqual(graph.get_tensor_dtype("Z2:0"), tf.int32)
  
      self.assertEqual(
          graph.get_tensor_shape("X:0"), tf.TensorShape([3, 4])
      )
      self.assertEqual(
          graph.get_tensor_shape("Y:0"), tf.TensorShape([4, 5])
      )
      self.assertEqual(
          graph.get_tensor_shape("Z1:0"), tf.TensorShape([3, 5])
      )
      self.assertEqual(
          graph.get_tensor_shape("Z2:0"), tf.TensorShape([3, 5])
      )
  
      self.assertEqual(graph.get_tensor_num_entries("X:0"), 12)
      self.assertEqual(graph.get_tensor_num_entries("Y:0"), 20)
      self.assertEqual(graph.get_tensor_num_entries("Z1:0"), 15)
      self.assertEqual(graph.get_tensor_num_entries("Z2:0"), 15)
  
      graph.set_tensor_final("Z1:0")
  
      self.assertEqual(
          graph.compute_memory_contents_under_schedule([0, 1, 2, 3]),
          [
              frozenset(["X:0"]),
              frozenset(["X:0", "Y:0"]),
              frozenset(["X:0", "Y:0", "Z1:0"]),
              frozenset(["X:0", "Y:0", "Z1:0", "Z2:0"]),
          ],
      )
      self.assertEqual(
          graph.compute_memory_contents_under_schedule([0, 1, 3, 2]),
          [
              frozenset(["X:0"]),
              frozenset(["X:0", "Y:0"]),
              frozenset(["X:0", "Y:0", "Z2:0"]),
              frozenset(["X:0", "Y:0", "Z1:0"]),
          ],
      )
  
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 3 for calling the GraphInterfaceTest obj's underlying member method code with example usage: obj.VerifyGraphInterface(graph) without return types