tf.contrib.copy_graph.copy_op_to_graph
Stay organized with collections
Save and categorize content based on your preferences.
Returns a copy of an operation from another Graph under a specified scope.
tf.contrib.copy_graph.copy_op_to_graph(
org_instance, to_graph, variables, scope=''
)
Given an Operation
org_instance
from one Graph
,
initializes and returns a copy of it from another Graph
,
under the specified scope (default ""
).
The copying is done recursively, so any Operation
whose output
is required to evaluate the org_instance
, is also copied (unless
already done).
Since Variable
instances are copied separately, those required
to evaluate org_instance
must be provided as input.
Args |
org_instance
|
An Operation from some Graph . Could be a
Placeholder as well.
|
to_graph
|
The Graph to copy org_instance to.
|
variables
|
An iterable of Variable instances to copy org_instance to.
|
scope
|
A scope for the new Variable (default "" ).
|
Returns |
The copied Operation from to_graph .
|
Raises |
TypeError
|
If org_instance is not an Operation or Tensor .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[],null,["# tf.contrib.copy_graph.copy_op_to_graph\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/copy_graph/python/util/copy_elements.py#L101-L230) |\n\nReturns a copy of an operation from another Graph under a specified scope. \n\n tf.contrib.copy_graph.copy_op_to_graph(\n org_instance, to_graph, variables, scope=''\n )\n\nGiven an `Operation` `org_instance` from one `Graph`,\ninitializes and returns a copy of it from another `Graph`,\nunder the specified scope (default `\"\"`).\n\nThe copying is done recursively, so any `Operation` whose output\nis required to evaluate the `org_instance`, is also copied (unless\nalready done).\n\nSince `Variable` instances are copied separately, those required\nto evaluate `org_instance` must be provided as input.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------|---------------------------------------------------------------------|\n| `org_instance` | An `Operation` from some `Graph`. Could be a `Placeholder` as well. |\n| `to_graph` | The `Graph` to copy `org_instance` to. |\n| `variables` | An iterable of `Variable` instances to copy `org_instance` to. |\n| `scope` | A scope for the new `Variable` (default `\"\"`). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| The copied `Operation` from `to_graph`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|------------------------------------------------------|\n| `TypeError` | If `org_instance` is not an `Operation` or `Tensor`. |\n\n\u003cbr /\u003e"]]