From 2a83828cf3eddf1c31913336cafa20e038559336 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Fri, 29 Jul 2016 16:14:24 -0800 Subject: Create a type alias "Output" for "Tensor". Plan is to eventually switch to Output and delete Tensor, to match the C++ API. Change: 128863361 --- tensorflow/g3doc/api_docs/python/framework.md | 5 ++++- .../api_docs/python/functions_and_classes/shard1/tf.Tensor.md | 5 ++++- tensorflow/python/framework/framework_lib.py | 1 + tensorflow/python/framework/ops.py | 9 ++++++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tensorflow/g3doc/api_docs/python/framework.md b/tensorflow/g3doc/api_docs/python/framework.md index 6108155a0e..9bc9111fc3 100644 --- a/tensorflow/g3doc/api_docs/python/framework.md +++ b/tensorflow/g3doc/api_docs/python/framework.md @@ -1105,7 +1105,10 @@ DEPRECATED: Use outputs. ### `class tf.Tensor` {#Tensor} -Represents a value produced by an `Operation`. +Represents one of the outputs of an `Operation`. + +*Note:* the `Tensor` class will be replaced by `Output` in the future. +Currently these two are aliases for each other. A `Tensor` is a symbolic handle to one of the outputs of an `Operation`. It does not hold the values of that operation's output, diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.Tensor.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.Tensor.md index 73af134a7a..6925d9d6d7 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.Tensor.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard1/tf.Tensor.md @@ -1,4 +1,7 @@ -Represents a value produced by an `Operation`. +Represents one of the outputs of an `Operation`. + +*Note:* the `Tensor` class will be replaced by `Output` in the future. +Currently these two are aliases for each other. A `Tensor` is a symbolic handle to one of the outputs of an `Operation`. It does not hold the values of that operation's output, diff --git a/tensorflow/python/framework/framework_lib.py b/tensorflow/python/framework/framework_lib.py index b06605cf59..3f77187a25 100644 --- a/tensorflow/python/framework/framework_lib.py +++ b/tensorflow/python/framework/framework_lib.py @@ -72,6 +72,7 @@ from tensorflow.python.framework.device import DeviceSpec from tensorflow.python.framework.ops import Graph from tensorflow.python.framework.ops import Operation from tensorflow.python.framework.ops import Tensor +from tensorflow.python.framework.ops import Output from tensorflow.python.framework.ops import SparseTensor from tensorflow.python.framework.ops import SparseTensorValue from tensorflow.python.framework.ops import IndexedSlices diff --git a/tensorflow/python/framework/ops.py b/tensorflow/python/framework/ops.py index f89f3d4697..854d46b955 100644 --- a/tensorflow/python/framework/ops.py +++ b/tensorflow/python/framework/ops.py @@ -185,7 +185,10 @@ def register_dense_tensor_like_type(tensor_type): class Tensor(object): - """Represents a value produced by an `Operation`. + """Represents one of the outputs of an `Operation`. + + *Note:* the `Tensor` class will be replaced by `Output` in the future. + Currently these two are aliases for each other. A `Tensor` is a symbolic handle to one of the outputs of an `Operation`. It does not hold the values of that operation's output, @@ -556,6 +559,10 @@ class Tensor(object): return _eval_using_default_session(self, feed_dict, self.graph, session) +# TODO(josh11b): Switch everyone from "Tensor" to "Output" to match C++ API. +Output = Tensor + + def _TensorTensorConversionFunction(t, dtype=None, name=None, as_ref=False): _ = name, as_ref if dtype and not dtype.is_compatible_with(t.dtype): -- cgit v1.2.3