parameters: (target, dst_graph, dst_scope="", src_scope="")
docstring: Find corresponding op/tensor in a different graph.
  
    Args:
      target: A `tf.Tensor` or a `tf.Operation` belonging to the original graph.
      dst_graph: The graph in which the corresponding graph element must be found.
      dst_scope: A scope which is prepended to the name to look for.
      src_scope: A scope which is removed from the original of `target` name.
  
    Returns:
      The corresponding tf.Tensor` or a `tf.Operation`.
  
    Raises:
      ValueError: if `src_name` does not start with `src_scope`.
      TypeError: if `target` is not a `tf.Tensor` or a `tf.Operation`
      KeyError: If the corresponding graph element cannot be found.
docstring_summary: Find corresponding op/tensor in a different graph.
docstring_tokens: Find corresponding op / tensor in a different graph .
function: def find_corresponding_elem(target, dst_graph, dst_scope="", src_scope=""):
    """Find corresponding op/tensor in a different graph.
  
    Args:
      target: A `tf.Tensor` or a `tf.Operation` belonging to the original graph.
      dst_graph: The graph in which the corresponding graph element must be found.
      dst_scope: A scope which is prepended to the name to look for.
      src_scope: A scope which is removed from the original of `target` name.
  
    Returns:
      The corresponding tf.Tensor` or a `tf.Operation`.
  
    Raises:
      ValueError: if `src_name` does not start with `src_scope`.
      TypeError: if `target` is not a `tf.Tensor` or a `tf.Operation`
      KeyError: If the corresponding graph element cannot be found.
    """
    src_name = target.name
    if src_scope:
      src_scope = scope_finalize(src_scope)
      if not src_name.startswidth(src_scope):
        raise ValueError("{} does not start with {}".format(src_name, src_scope))
      src_name = src_name[len(src_scope):]
  
    dst_name = src_name
    if dst_scope:
      dst_scope = scope_finalize(dst_scope)
      dst_name = dst_scope + dst_name
  
    if isinstance(target, tf_ops.Tensor):
      return dst_graph.get_tensor_by_name(dst_name)
    if isinstance(target, tf_ops.Operation):
      return dst_graph.get_operation_by_name(dst_name)
    raise TypeError("Expected tf.Tensor or tf.Operation, got: {}", type(target))
function_tokens: def find_corresponding_elem ( target , dst_graph , dst_scope = "" , src_scope = "" ) : src_name = target . name if src_scope : src_scope = scope_finalize ( src_scope ) if not src_name . startswidth ( src_scope ) : raise ValueError ( "{} does not start with {}" . format ( src_name , src_scope ) ) src_name = src_name [ len ( src_scope ) : ] dst_name = src_name if dst_scope : dst_scope = scope_finalize ( dst_scope ) dst_name = dst_scope + dst_name if isinstance ( target , tf_ops . Tensor ) : return dst_graph . get_tensor_by_name ( dst_name ) if isinstance ( target , tf_ops . Operation ) : return dst_graph . get_operation_by_name ( dst_name ) raise TypeError ( "Expected tf.Tensor or tf.Operation, got: {}" , type ( target ) )