code: def get_tensors(graph):
      """get all the tensors which are input or output of an op in the graph.
  
      Args:
        graph: a `tf.Graph`.
      Returns:
        A list of `tf.Tensor`.
      Raises:
        TypeError: if graph is not a `tf.Graph`.
      """
      if not isinstance(graph, ops.Graph):
          raise TypeError(
              "Expected a graph, got: {}".format(type(graph))
          )
      ts = []
      for op in graph.get_operations():
          ts += op.outputs
      return ts
  
imports: from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 4 for calling a global function with example usage: get_tensors(graph) and returns: ts