code: def _add_shapes(graph, builder, fetches):
      names = [fetch.name for fetch in fetches]
      shapes = [_get_shape(fetch) for fetch in fetches]
      # We still need to do the placeholders, it seems their shape is not passed in when some
      # dimensions are unknown
      ph_names = []
      ph_shapes = []
      for n in graph.as_graph_def(add_shapes=True).node:
          # Just the input nodes which have output:
          if not n.input and n.attr:
              op_name = n.name
              # Simply get the default output for now, assume that the nodes have only one output
              t = graph.get_tensor_by_name(op_name + ":0")
              ph_names.append(t.name)
              ph_shapes.append(_get_shape(t))
      logger.info("fetches: %s %s", str(names), str(shapes))
      logger.info("inputs: %s %s", str(ph_names), str(ph_shapes))
      builder.shape(names + ph_names, shapes + ph_shapes)
      builder.fetches(names)
      # return the path, not the tensor name.
      return [t_name.replace(":0", "") for t_name in ph_names]
  
imports: import tensorflow
  import numpy
  import logging
  import tempfile
  import pandas
  from pyspark import RDD, SparkContext
  from pyspark.sql import SQLContext, Row, DataFrame
  from pyspark.sql.types import DoubleType, IntegerType, LongType, FloatType, ArrayType
label_desc: Use image node_id 5 for calling a global function with example usage: _add_shapes(graph, builder, fetches) and returns: unknown