aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/graph_editor
diff options
context:
space:
mode:
authorGravatar Jonathan Hseu <jhseu@google.com>2016-11-16 17:04:14 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-16 17:22:34 -0800
commit7e8728662120df0a80720bb7527613f96d58271e (patch)
tree7a224c0cbd874c05be01445750d1526166abed0b /tensorflow/contrib/graph_editor
parentd38fb783e5c1801949ea9ccebfd14afa1cb17dff (diff)
Rename `Tensor` to `Output` in all Python docs
Generated by running: $ find . -name '*.py' | xargs sed -i 's/a `Tensor`/an `Output`/g' $ find . -name '*.py' | xargs sed -i 's/A `Tensor`/An `Output`/g' $ find . -name '*.py' | xargs sed -i 's/`Tensor`/`Output`/g' $ find . -name '*.py' | xargs sed -i 's/`tf.Tensor`/`tf.Output`/g' $ find . -name '*.py' | xargs sed -i 's/`Tensors`/`Output`s/g' $ find . -name '*.py' | xargs sed -i 's/#Tensor)/#Output)/g' $ find . -name '*.py' | xargs sed -i 's/#Tensor\./#Output./g' Manually fixed up lines that exceeded 80 characters after the change. Change: 139400135
Diffstat (limited to 'tensorflow/contrib/graph_editor')
-rw-r--r--tensorflow/contrib/graph_editor/reroute.py22
-rw-r--r--tensorflow/contrib/graph_editor/select.py16
-rw-r--r--tensorflow/contrib/graph_editor/subgraph.py8
-rw-r--r--tensorflow/contrib/graph_editor/transform.py2
-rw-r--r--tensorflow/contrib/graph_editor/util.py24
5 files changed, 36 insertions, 36 deletions
diff --git a/tensorflow/contrib/graph_editor/reroute.py b/tensorflow/contrib/graph_editor/reroute.py
index 5728435113..dd3e7ea7f4 100644
--- a/tensorflow/contrib/graph_editor/reroute.py
+++ b/tensorflow/contrib/graph_editor/reroute.py
@@ -44,8 +44,8 @@ def _check_ts_compatibility(ts0, ts1):
"""Make sure the shape and dtype of the two tensor's lists are compatible.
Args:
- ts0: an object convertible to a list of `tf.Tensor`.
- ts1: an object convertible to a list of `tf.Tensor`.
+ ts0: an object convertible to a list of `tf.Output`.
+ ts1: an object convertible to a list of `tf.Output`.
Raises:
ValueError: if any pair of tensors (same index in ts0 and ts1) have
a dtype or a shape which is not compatible.
@@ -163,8 +163,8 @@ def _reroute_ts(ts0, ts1, mode, can_modify=None, cannot_modify=None):
Warning: this function is directly manipulating the internals of the tf.Graph.
Args:
- ts0: an object convertible to a list of `tf.Tensor`.
- ts1: an object convertible to a list of `tf.Tensor`.
+ ts0: an object convertible to a list of `tf.Output`.
+ ts1: an object convertible to a list of `tf.Output`.
mode: what to do with those tensors: "a->b" or "b<->a" for swaping and
"a->b" or "b->a" for one direction re-routing.
can_modify: iterable of operations which can be modified. Any operation
@@ -175,7 +175,7 @@ def _reroute_ts(ts0, ts1, mode, can_modify=None, cannot_modify=None):
Returns:
The number of individual modifications made by the function.
Raises:
- TypeError: if `ts0` or `ts1` cannot be converted to a list of `tf.Tensor`.
+ TypeError: if `ts0` or `ts1` cannot be converted to a list of `tf.Output`.
TypeError: if `can_modify` or `cannot_modify` is not `None` and cannot be
converted to a list of `tf.Operation`.
"""
@@ -215,8 +215,8 @@ def swap_ts(ts0, ts1, can_modify=None, cannot_modify=None):
A0 A1 A0 A1
Args:
- ts0: an object convertible to a list of `tf.Tensor`.
- ts1: an object convertible to a list of `tf.Tensor`.
+ ts0: an object convertible to a list of `tf.Output`.
+ ts1: an object convertible to a list of `tf.Output`.
can_modify: iterable of operations which can be modified. Any operation
outside within_ops will be left untouched by this function.
cannot_modify: iterable of operations which cannot be modified.
@@ -242,8 +242,8 @@ def reroute_a2b_ts(ts0, ts1, can_modify=None, cannot_modify=None):
The end of the tensors in ts1 are left dangling.
Args:
- ts0: an object convertible to a list of `tf.Tensor`.
- ts1: an object convertible to a list of `tf.Tensor`.
+ ts0: an object convertible to a list of `tf.Output`.
+ ts1: an object convertible to a list of `tf.Output`.
can_modify: iterable of operations which can be modified. Any operation
outside within_ops will be left untouched by this function.
cannot_modify: iterable of operations which cannot be modified. Any
@@ -268,8 +268,8 @@ def reroute_b2a_ts(ts0, ts1, can_modify=None, cannot_modify=None):
The end of the tensors in ts0 are left dangling.
Args:
- ts0: an object convertible to a list of `tf.Tensor`.
- ts1: an object convertible to a list of `tf.Tensor`.
+ ts0: an object convertible to a list of `tf.Output`.
+ ts1: an object convertible to a list of `tf.Output`.
can_modify: iterable of operations which can be modified. Any operation
outside within_ops will be left untouched by this function.
cannot_modify: iterable of operations which cannot be modified.
diff --git a/tensorflow/contrib/graph_editor/select.py b/tensorflow/contrib/graph_editor/select.py
index 0e2914cb0d..8253bc1943 100644
--- a/tensorflow/contrib/graph_editor/select.py
+++ b/tensorflow/contrib/graph_editor/select.py
@@ -119,7 +119,7 @@ def filter_ts(ops, positive_filter):
positive_filter: a function deciding whether to keep a tensor or not.
If `True`, all the tensors are returned.
Returns:
- A list of `tf.Tensor`.
+ A list of `tf.Output`.
Raises:
TypeError: if ops cannot be converted to a list of `tf.Operation`.
"""
@@ -616,7 +616,7 @@ def select_ops(*args, **kwargs):
Args:
*args: list of 1) regular expressions (compiled or not) or 2) (array of)
- `tf.Operation`. `tf.Tensor` instances are silently ignored.
+ `tf.Operation`. `tf.Output` instances are silently ignored.
**kwargs: 'graph': `tf.Graph` in which to perform the regex query.This is
required when using regex.
'positive_filter': an elem if selected only if `positive_filter(elem)` is
@@ -628,7 +628,7 @@ def select_ops(*args, **kwargs):
Raises:
TypeError: if the optional keyword argument graph is not a `tf.Graph`
or if an argument in args is not an (array of) `tf.Operation`
- or an (array of) `tf.Tensor` (silently ignored) or a string
+ or an (array of) `tf.Output` (silently ignored) or a string
or a regular expression.
ValueError: if one of the keyword arguments is unexpected or if a regular
expression is used without passing a graph as a keyword argument.
@@ -682,7 +682,7 @@ def select_ts(*args, **kwargs):
Args:
*args: list of 1) regular expressions (compiled or not) or 2) (array of)
- `tf.Tensor`. `tf.Operation` instances are silently ignored.
+ `tf.Output`. `tf.Operation` instances are silently ignored.
**kwargs: 'graph': `tf.Graph` in which to perform the regex query.This is
required when using regex.
'positive_filter': an elem if selected only if `positive_filter(elem)` is
@@ -690,10 +690,10 @@ def select_ts(*args, **kwargs):
'restrict_ts_regex': a regular expression is ignored if it doesn't start
with the substring "(?#ts)".
Returns:
- A list of `tf.Tensor`.
+ A list of `tf.Output`.
Raises:
TypeError: if the optional keyword argument graph is not a `tf.Graph`
- or if an argument in args is not an (array of) `tf.Tensor`
+ or if an argument in args is not an (array of) `tf.Output`
or an (array of) `tf.Operation` (silently ignored) or a string
or a regular expression.
ValueError: if one of the keyword arguments is unexpected or if a regular
@@ -758,10 +758,10 @@ def select_ops_and_ts(*args, **kwargs):
Returns:
A tuple `(ops, ts)` where:
`ops` is a list of `tf.Operation`, and
- `ts` is a list of `tf.Tensor`
+ `ts` is a list of `tf.Output`
Raises:
TypeError: if the optional keyword argument graph is not a `tf.Graph`
- or if an argument in args is not an (array of) `tf.Tensor`
+ or if an argument in args is not an (array of) `tf.Output`
or an (array of) `tf.Operation` or a string or a regular expression.
ValueError: if one of the keyword arguments is unexpected or if a regular
expression is used without passing a graph as a keyword argument.
diff --git a/tensorflow/contrib/graph_editor/subgraph.py b/tensorflow/contrib/graph_editor/subgraph.py
index 00a755c79f..e678823245 100644
--- a/tensorflow/contrib/graph_editor/subgraph.py
+++ b/tensorflow/contrib/graph_editor/subgraph.py
@@ -165,14 +165,14 @@ class SubGraphView(object):
Args:
inside_ops: an object convertible to a list of `tf.Operation`. This list
defines all the operations in the subgraph.
- passthrough_ts: an object convertible to a list of `tf.Tensor`. This list
+ passthrough_ts: an object convertible to a list of `tf.Output`. This list
define all the "passthrough" tensors. A passthrough tensor is a tensor
which goes directly from the input of the subgraph to it output, without
any intermediate operations. All the non passthrough tensors are
silently ignored.
Raises:
TypeError: if inside_ops cannot be converted to a list of `tf.Operation`
- or if `passthrough_ts` cannot be converted to a list of `tf.Tensor`.
+ or if `passthrough_ts` cannot be converted to a list of `tf.Output`.
"""
inside_ops = util.make_list_of_op(inside_ops)
@@ -598,7 +598,7 @@ def make_view(*args, **kwargs):
Args:
*args: list of 1) regular expressions (compiled or not) or 2) (array of)
- `tf.Operation` 3) (array of) `tf.Tensor`. Those objects will be converted
+ `tf.Operation` 3) (array of) `tf.Output`. Those objects will be converted
into a list of operations and a list of candidate for passthrough tensors.
**kwargs: keyword graph is used 1) to check that the ops and ts are from
the correct graph 2) for regular expression query
@@ -606,7 +606,7 @@ def make_view(*args, **kwargs):
A subgraph view.
Raises:
TypeError: if the optional keyword argument graph is not a `tf.Graph`
- or if an argument in args is not an (array of) `tf.Tensor`
+ or if an argument in args is not an (array of) `tf.Output`
or an (array of) `tf.Operation` or a string or a regular expression.
ValueError: if one of the keyword arguments is unexpected.
"""
diff --git a/tensorflow/contrib/graph_editor/transform.py b/tensorflow/contrib/graph_editor/transform.py
index 26047437d7..b62b15d22c 100644
--- a/tensorflow/contrib/graph_editor/transform.py
+++ b/tensorflow/contrib/graph_editor/transform.py
@@ -89,7 +89,7 @@ def assign_renamed_collections_handler(info, elem, elem_):
Args:
info: Transform._Info instance.
- elem: the original element (`tf.Tensor` or `tf.Operation`)
+ elem: the original element (`tf.Output` or `tf.Operation`)
elem_: the transformed element
"""
# TODO(fkp): handle known special cases
diff --git a/tensorflow/contrib/graph_editor/util.py b/tensorflow/contrib/graph_editor/util.py
index 11ee2435c9..a72d0e34b4 100644
--- a/tensorflow/contrib/graph_editor/util.py
+++ b/tensorflow/contrib/graph_editor/util.py
@@ -210,7 +210,7 @@ def make_list_of_op(ops, check_graph=True, allow_graph=True, ignore_ts=False):
operation.
check_graph: if `True` check if all the operations belong to the same graph.
allow_graph: if `False` a `tf.Graph` cannot be converted.
- ignore_ts: if True, silently ignore `tf.Tensor`.
+ ignore_ts: if True, silently ignore `tf.Output`.
Returns:
A newly created list of `tf.Operation`.
Raises:
@@ -241,7 +241,7 @@ def get_tensors(graph):
Args:
graph: a `tf.Graph`.
Returns:
- A list of `tf.Tensor`.
+ A list of `tf.Output`.
Raises:
TypeError: if graph is not a `tf.Graph`.
"""
@@ -254,17 +254,17 @@ def get_tensors(graph):
def make_list_of_t(ts, check_graph=True, allow_graph=True, ignore_ops=False):
- """Convert ts to a list of `tf.Tensor`.
+ """Convert ts to a list of `tf.Output`.
Args:
- ts: can be an iterable of `tf.Tensor`, a `tf.Graph` or a single tensor.
+ ts: can be an iterable of `tf.Output`, a `tf.Graph` or a single tensor.
check_graph: if `True` check if all the tensors belong to the same graph.
allow_graph: if `False` a `tf.Graph` cannot be converted.
ignore_ops: if `True`, silently ignore `tf.Operation`.
Returns:
- A newly created list of `tf.Tensor`.
+ A newly created list of `tf.Output`.
Raises:
- TypeError: if `ts` cannot be converted to a list of `tf.Tensor` or,
+ TypeError: if `ts` cannot be converted to a list of `tf.Output` or,
if `check_graph` is `True`, if all the ops do not belong to the same graph.
"""
if isinstance(ts, tf_ops.Graph):
@@ -287,11 +287,11 @@ def get_generating_ops(ts):
"""Return all the generating ops of the tensors in `ts`.
Args:
- ts: a list of `tf.Tensor`
+ ts: a list of `tf.Output`
Returns:
A list of all the generating `tf.Operation` of the tensors in `ts`.
Raises:
- TypeError: if `ts` cannot be converted to a list of `tf.Tensor`.
+ TypeError: if `ts` cannot be converted to a list of `tf.Output`.
"""
ts = make_list_of_t(ts, allow_graph=False)
return [t.op for t in ts]
@@ -301,11 +301,11 @@ def get_consuming_ops(ts):
"""Return all the consuming ops of the tensors in ts.
Args:
- ts: a list of `tf.Tensor`
+ ts: a list of `tf.Output`
Returns:
A list of all the consuming `tf.Operation` of the tensors in `ts`.
Raises:
- TypeError: if ts cannot be converted to a list of `tf.Tensor`.
+ TypeError: if ts cannot be converted to a list of `tf.Output`.
"""
ts = make_list_of_t(ts, allow_graph=False)
ops = []
@@ -434,14 +434,14 @@ def make_placeholder_from_tensor(t, scope=None):
Note that the correct graph scope must be set by the calling function.
Args:
- t: a `tf.Tensor` whose name will be used to create the placeholder
+ t: a `tf.Output` whose name will be used to create the placeholder
(see function placeholder_name).
scope: absolute scope within which to create the placeholder. None
means that the scope of `t` is preserved. `""` means the root scope.
Returns:
A newly created `tf.placeholder`.
Raises:
- TypeError: if `t` is not `None` or a `tf.Tensor`.
+ TypeError: if `t` is not `None` or a `tf.Output`.
"""
return tf_array_ops.placeholder(
dtype=t.dtype, shape=t.get_shape(), name=placeholder_name(