Home
last modified time | relevance | path

Searched refs:shallow_tree (Results 1 – 4 of 4) sorted by relevance

/external/tensorflow/tensorflow/python/util/
Dnest_test.py518 nest.assert_shallow_structure(shallow_tree=inp_abc, input_tree=inp_ab)
551 shallow_tree = [[True, True], [False, True]]
552 flattened_input_tree = nest.flatten_up_to(shallow_tree, input_tree)
553 flattened_shallow_tree = nest.flatten_up_to(shallow_tree, shallow_tree)
559 shallow_tree = [["level_1", ["level_2", ["level_3", ["level_4"]]]]]
560 input_tree_flattened_as_shallow_tree = nest.flatten_up_to(shallow_tree,
569 shallow_tree = {"a": 0, "b": 0, "d": [0, 0]}
570 input_tree_flattened_as_shallow_tree = nest.flatten_up_to(shallow_tree,
578 shallow_tree = ab_tuple(a=0, b=1)
579 input_tree_flattened_as_shallow_tree = nest.flatten_up_to(shallow_tree,
[all …]
Dnest.py591 def _yield_flat_up_to(shallow_tree, input_tree, path=()): argument
607 if (isinstance(shallow_tree, _six.string_types) or
608 not any([isinstance(shallow_tree, _collections.Sequence),
609 isinstance(shallow_tree, _collections.Mapping),
610 _is_namedtuple(shallow_tree),
611 _is_attrs(shallow_tree)])):
615 for shallow_key, shallow_subtree in _yield_sorted_items(shallow_tree):
624 def assert_shallow_structure(shallow_tree, input_tree, check_types=True): argument
662 if is_sequence(shallow_tree):
668 if check_types and not isinstance(input_tree, type(shallow_tree)):
[all …]
/external/tensorflow/tensorflow/python/data/util/
Dnest_test.py307 shallow_tree = ((True, True), (False, True))
308 flattened_input_tree = nest.flatten_up_to(shallow_tree, input_tree)
309 flattened_shallow_tree = nest.flatten_up_to(shallow_tree, shallow_tree)
314 shallow_tree = (("level_1", ("level_2", ("level_3", ("level_4")))))
315 input_tree_flattened_as_shallow_tree = nest.flatten_up_to(shallow_tree,
325 shallow_tree = "shallow_tree"
326 flattened_input_tree = nest.flatten_up_to(shallow_tree, input_tree)
327 flattened_shallow_tree = nest.flatten_up_to(shallow_tree, shallow_tree)
329 self.assertEqual(flattened_shallow_tree, [shallow_tree])
332 shallow_tree = "shallow_tree"
[all …]
Dnest.py250 def _yield_flat_up_to(shallow_tree, input_tree): argument
252 if is_sequence(shallow_tree):
253 for shallow_branch, input_branch in zip(_yield_value(shallow_tree),
261 def assert_shallow_structure(shallow_tree, input_tree, check_types=True): argument
297 if is_sequence(shallow_tree):
303 if check_types and not isinstance(input_tree, type(shallow_tree)):
307 % (type(input_tree), type(shallow_tree)))
309 if len(input_tree) != len(shallow_tree):
313 % (len(input_tree), len(shallow_tree)))
315 if check_types and isinstance(shallow_tree, dict):
[all …]