code: def _create_placeholder_node_from_existing_node(
      node: tf.compat.v1.NodeDef, graph: tf.Graph
  ) -> tf.compat.v1.NodeDef:
      """Creates a placeholder node to represent an existing node.
  
      Some partitioned subgraphs may require inputs that are loaded or computed
      previously. Hence, we replace the input nodes with placeholder nodes that
      share the same name, shape, and dtype. Now the inputs become placeholders
      inside partitioned subgraphs, and can be loaded by feed dicts at the runtime.
  
      Args:
        node: A `NodeDef` proto for the existing node.
        graph: A tf.Graph instance for the graph that contains the existing node.
  
      Returns:
        A `NodeDef` proto that stores a placeholder node.
      """
      operation = graph.get_operation_by_name("import/%s" % (node.name))
      output_tensor = operation.outputs[0]
  
      with tf.compat.v1.Session(graph=tf.Graph()) as sess:
          tf.compat.v1.placeholder(
              dtype=output_tensor.dtype,
              shape=output_tensor.shape,
              name=node.name,
          )
          return sess.graph_def.node[0]
  
imports: import collections
  from typing import Dict, List, Mapping, Set
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.experimental.distributed_inference.graphdef_experiments.subgraph_partitioning import execution_spec
label_desc: Use image node_id 14 for calling a global function with example usage: _create_placeholder_node_from_existing_node(node, graph) and returns: sess