code: def tensor_shape_from_node_def_name(graph, input_name):
      """Convenience function to get a shape from a NodeDef's input string."""
      # To get a tensor, the name must be in the form <input>:<port>, for example
      # 'Mul:0'. The GraphDef input strings don't always have the port specified
      # though, so if there isn't a colon we need to add a default ':0' to the end.
      if ":" not in input_name:
          canonical_name = input_name + ":0"
      else:
          canonical_name = input_name
      tensor = graph.get_tensor_by_name(canonical_name)
      shape = tensor.get_shape()
      return shape
  
file_path: tensorflow-upstream/tensorflow/python/framework/graph_util_impl.py
imports: import copy
  import re
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.framework import node_def_pb2
  from tensorflow.python.framework import _proto_comparators
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.util import deprecation
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 9 for calling a global function with example usage: tensor_shape_from_node_def_name(graph, input_name) and returns: shape