aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/estimator
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-09-17 15:11:35 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-17 15:19:55 -0700
commit77a1883c9dde50efdf9505528adf636ed991e431 (patch)
tree62d44f10649207270d8bde702e03ba3577e8fe41 /tensorflow/python/estimator
parentbb30dfce198341b2ec80d0aa22b49eaa5eac533b (diff)
Fix _check_is_tensor like _check_is_tensor_or_operation was fixed in #22264.
PiperOrigin-RevId: 213346485
Diffstat (limited to 'tensorflow/python/estimator')
-rw-r--r--tensorflow/python/estimator/model_fn.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tensorflow/python/estimator/model_fn.py b/tensorflow/python/estimator/model_fn.py
index 331a9d1a05..0f26a5bba4 100644
--- a/tensorflow/python/estimator/model_fn.py
+++ b/tensorflow/python/estimator/model_fn.py
@@ -26,7 +26,6 @@ import six
from tensorflow.python.estimator.export import export_output as export_output_lib
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
-from tensorflow.python.framework import tensor_util
from tensorflow.python.keras.metrics import Metric
from tensorflow.python.ops import array_ops
from tensorflow.python.saved_model import signature_constants
@@ -467,13 +466,13 @@ class _TPUEstimatorSpec(
def _check_is_tensor_or_operation(x, name):
- if not (isinstance(x, ops.Operation) or tensor_util.is_tensor(x)):
+ if not (isinstance(x, ops.Operation) or ops.is_dense_tensor_like(x)):
raise TypeError('{} must be Operation or Tensor, given: {}'.format(name, x))
def _check_is_tensor(x, tensor_name):
"""Returns `x` if it is a `Tensor`, raises TypeError otherwise."""
- if not isinstance(x, ops.Tensor):
+ if not ops.is_dense_tensor_like(x):
raise TypeError('{} must be Tensor, given: {}'.format(tensor_name, x))
return x