diff options
author | 在原佐为 <ariwaranosai@users.noreply.github.com> | 2018-09-04 23:25:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-04 23:25:30 +0800 |
commit | ad997f1c24829dbe3c687d449a757202c401bb6f (patch) | |
tree | d12bd80830000e7c76670db1eef740899f2cf904 /tensorflow/contrib/autograph | |
parent | 752e94a7d73a5c11a1b51b08bc170b0d91724a1c (diff) |
only apply _string_get_item for string with rank 0
Diffstat (limited to 'tensorflow/contrib/autograph')
-rw-r--r-- | tensorflow/contrib/autograph/operators/slices.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/contrib/autograph/operators/slices.py b/tensorflow/contrib/autograph/operators/slices.py index d878bddf3c..a885bdab5b 100644 --- a/tensorflow/contrib/autograph/operators/slices.py +++ b/tensorflow/contrib/autograph/operators/slices.py @@ -58,7 +58,7 @@ def get_item(target, i, opts): elif tensor_util.is_tensor(target): if target.dtype == dtypes.variant: return _tf_tensor_list_get_item(target, i, opts) - if target.dtype == dtypes.string: + elif target.dtype == dtypes.string and target.get_shape() == (): # target is string with rank 0 return _tf_tensor_string_get_item(target, i) else: return _tf_tensor_get_item(target, i) |