diff options
author | 2018-07-23 16:47:57 -0700 | |
---|---|---|
committer | 2018-07-23 16:52:18 -0700 | |
commit | 808db1f8d49618e64170f174998bf1e0db49701f (patch) | |
tree | b34f6682edd62855cfbb3a462745346b9b56ebc9 | |
parent | 7087243b8594faa92b274b92d586cbb2d3b24bfe (diff) |
Allow ResourceVariable to be written to TensorArray.
This is similar to how graph behaves.
PiperOrigin-RevId: 205747377
-rw-r--r-- | tensorflow/python/ops/tensor_array_ops.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/python/ops/tensor_array_ops.py b/tensorflow/python/ops/tensor_array_ops.py index cc92da4fd7..f86dfb3527 100644 --- a/tensorflow/python/ops/tensor_array_ops.py +++ b/tensorflow/python/ops/tensor_array_ops.py @@ -554,7 +554,7 @@ class _EagerTensorArray(object): self._tensor_array.extend([None for _ in range(index - size + 1)]) if not isinstance(value, ops.EagerTensor): - value = constant_op.constant(value) + value = ops.convert_to_tensor(value) if self._infer_shape: if self._element_shape is None: @@ -633,8 +633,8 @@ class _EagerTensorArray(object): def split(self, value, lengths, name=None): """See TensorArray.""" # error checking to match graph-mode errors - value = constant_op.constant(value) - lengths = constant_op.constant(lengths) + value = ops.convert_to_tensor(value) + lengths = ops.convert_to_tensor(lengths) sum_lengths = math_ops.reduce_sum(lengths) if lengths.shape.ndims != 1: raise errors_impl.InvalidArgumentError( |