MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / is_iterable

Function is_iterable

tensorflow/contrib/graph_editor/util.py:99–107  ·  view source on GitHub ↗

Return true if the object is iterable.

(obj)

Source from the content-addressed store, hash-verified

97
98# TODO(fkp): very generic code, it should be moved in a more generic place.
99def is_iterable(obj):
100 """Return true if the object is iterable."""
101 if isinstance(obj, tf_ops.Tensor):
102 return False
103 try:
104 _ = iter(obj)
105 except Exception: # pylint: disable=broad-except
106 return False
107 return True
108
109
110def flatten_tree(tree, leaves=None):

Callers 5

flatten_treeFunction · 0.70
transform_treeFunction · 0.70
get_unique_graphFunction · 0.70
make_list_of_opFunction · 0.70
make_list_of_tFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected