diff options
author | Alexandre Passos <apassos@google.com> | 2017-11-03 11:01:59 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-11-03 11:05:33 -0700 |
commit | 7a3d505854b55814ab6e036c45601b656ec35942 (patch) | |
tree | 0c7b0b5a33c9085d2b7295d75e2c0aa89d8c04b1 /tensorflow/contrib/graph_editor | |
parent | 46ffa99df62b3ecdab65f9bbf202921205d59e68 (diff) |
Allowing __iter__ over 1+dimensional tensors with known shapes.
PiperOrigin-RevId: 174484601
Diffstat (limited to 'tensorflow/contrib/graph_editor')
-rw-r--r-- | tensorflow/contrib/graph_editor/util.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tensorflow/contrib/graph_editor/util.py b/tensorflow/contrib/graph_editor/util.py index 959905e982..30bc33b9ee 100644 --- a/tensorflow/contrib/graph_editor/util.py +++ b/tensorflow/contrib/graph_editor/util.py @@ -93,6 +93,8 @@ class ListView(object): # TODO(fkp): very generic code, it should be moved in a more generic place. def is_iterable(obj): """Return true if the object is iterable.""" + if isinstance(obj, tf_ops.Tensor): + return False try: _ = iter(obj) except Exception: # pylint: disable=broad-except |