aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/estimator
diff options
context:
space:
mode:
authorGravatar (David) Siu-Kei Muk <muksiukei@gmail.com>2018-09-14 05:59:05 +0800
committerGravatar (David) Siu-Kei Muk <muksiukei@gmail.com>2018-09-14 05:59:05 +0800
commit51d72a7d7f74784b68916819edd04e890b36f957 (patch)
treefdc503a4f000b8c5e3a3577a5d7579ca90b33596 /tensorflow/python/estimator
parent74bad410865b842ff8823f9327a9e2baff303729 (diff)
Modified "_check_is_tensor_or_operation" to check if "x" is "tensor_like"
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))