aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/estimator
diff options
context:
space:
mode:
authorGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-17 11:56:07 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-09-17 11:56:12 -0700
commita1ea2be7ce4d19c5cd098be2ecd1488a30605899 (patch)
tree30c951a60cb6045074f1ed5a88fd2cf805fca952 /tensorflow/python/estimator
parentdeec3bf519bd51f743db15ae28a6335d43ad5dfe (diff)
parentae7e8d01372a2df39dc5669b00735529c5cfffb9 (diff)
Merge pull request #22264 from dave-msk:est_spec_metrics_ops_check_tensor
PiperOrigin-RevId: 213311243
Diffstat (limited to 'tensorflow/python/estimator')
-rw-r--r--tensorflow/python/estimator/model_fn.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/estimator/model_fn.py b/tensorflow/python/estimator/model_fn.py
index 439cc2e3a4..331a9d1a05 100644
--- a/tensorflow/python/estimator/model_fn.py
+++ b/tensorflow/python/estimator/model_fn.py
@@ -26,6 +26,7 @@ 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
@@ -466,7 +467,7 @@ class _TPUEstimatorSpec(
def _check_is_tensor_or_operation(x, name):
- if not (isinstance(x, ops.Operation) or isinstance(x, ops.Tensor)):
+ if not (isinstance(x, ops.Operation) or tensor_util.is_tensor(x)):
raise TypeError('{} must be Operation or Tensor, given: {}'.format(name, x))