parameters: (sgv, replacement_ts,
                                   dst_graph=None, dst_scope="", src_scope="",
                                   reuse_dst_scope=False)
return_statement: return copier(
        sgv, dst_graph, dst_scope, src_scope, reuse_dst_scope=reuse_dst_scope)
docstring: Copy a subgraph, replacing some of its inputs.
  
    Note a replacement only happens if the tensor to be replaced
    is an input of the given subgraph. The inputs of a subgraph can
    be queried using sgv.inputs.
  
    Args:
      sgv: the source subgraph-view. This argument is converted to a subgraph
        using the same rules as the function subgraph.make_view.
      replacement_ts: dictionary mapping from original tensors to the
        replaced one.
      dst_graph: the destination graph.
      dst_scope: the destination scope.
      src_scope: the source scope.
      reuse_dst_scope: if True the dst_scope is re-used if it already exists.
        Otherwise, the scope is given a unique name based on the one given
        by appending an underscore followed by a digit (default).
    Returns:
      A tuple `(sgv, info)` where:
        `sgv` is the transformed subgraph view;
        `info` is an instance of TransformerInfo containing
        information about the transform, including mapping between
        original and transformed tensors and operations.
    Raises:
      TypeError: if dst_graph is not a tf.Graph.
      StandardError: if sgv cannot be converted to a SubGraphView using
        the same rules as the function subgraph.make_view.
docstring_summary: Copy a subgraph, replacing some of its inputs.
docstring_tokens: Copy a subgraph replacing some of its inputs .
function: def copy_with_input_replacements(sgv, replacement_ts,
                                   dst_graph=None, dst_scope="", src_scope="",
                                   reuse_dst_scope=False):
    """Copy a subgraph, replacing some of its inputs.
  
    Note a replacement only happens if the tensor to be replaced
    is an input of the given subgraph. The inputs of a subgraph can
    be queried using sgv.inputs.
  
    Args:
      sgv: the source subgraph-view. This argument is converted to a subgraph
        using the same rules as the function subgraph.make_view.
      replacement_ts: dictionary mapping from original tensors to the
        replaced one.
      dst_graph: the destination graph.
      dst_scope: the destination scope.
      src_scope: the source scope.
      reuse_dst_scope: if True the dst_scope is re-used if it already exists.
        Otherwise, the scope is given a unique name based on the one given
        by appending an underscore followed by a digit (default).
    Returns:
      A tuple `(sgv, info)` where:
        `sgv` is the transformed subgraph view;
        `info` is an instance of TransformerInfo containing
        information about the transform, including mapping between
        original and transformed tensors and operations.
    Raises:
      TypeError: if dst_graph is not a tf.Graph.
      StandardError: if sgv cannot be converted to a SubGraphView using
        the same rules as the function subgraph.make_view.
    """
    sgv = subgraph.make_view(sgv)
    if dst_graph is None:
      dst_graph = sgv.graph
    if not isinstance(dst_graph, tf_ops.Graph):
      raise TypeError("Expected a tf.Graph, got: {}".format(type(dst_graph)))
  
    copier = Transformer()
    # Replace tensor if possible.
    def replace_t_with_replacement_handler(info, t):
      if t in replacement_ts:
        return replacement_ts[t]
      else:
        return keep_t_if_possible_handler(info, t)
    copier.transform_external_input_handler = replace_t_with_replacement_handler
    return copier(
        sgv, dst_graph, dst_scope, src_scope, reuse_dst_scope=reuse_dst_scope)
function_tokens: def copy_with_input_replacements ( sgv , replacement_ts , dst_graph = None , dst_scope = "" , src_scope = "" , reuse_dst_scope = False ) : sgv = subgraph . make_view ( sgv ) if dst_graph is None : dst_graph = sgv . graph if not isinstance ( dst_graph , tf_ops . Graph ) : raise TypeError ( "Expected a tf.Graph, got: {}" . format ( type ( dst_graph ) ) ) copier = Transformer ( ) # Replace tensor if possible. def replace_t_with_replacement_handler ( info , t ) : if t in replacement_ts : return replacement_ts [ t ] else : return keep_t_if_possible_handler ( info , t ) copier . transform_external_input_handler = replace_t_with_replacement_handler return copier ( sgv , dst_graph , dst_scope , src_scope , reuse_dst_scope = reuse_dst_scope )