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

Method test_flatten

tensorflow/python/module/module_test.py:461–471  ·  view source on GitHub ↗
(self, container_type)

Source from the content-addressed store, hash-verified

459
460 @parameterized.parameters(lambda v: NamedPair(*v), list, tuple, mk_index_dict)
461 def test_flatten(self, container_type):
462 parent = SimpleModule(container_type=container_type)
463 child = parent.c
464
465 self.assertEqual(
466 list(parent._flatten(recursive=False, predicate=is_member)),
467 [parent.a[0], parent.a[1], parent.z])
468
469 self.assertEqual(
470 list(parent._flatten(predicate=is_member)),
471 [parent.a[0], parent.a[1], parent.z, child.a[0], child.a[1], child.z])
472
473 def test_attribute_traversal_key(self):
474 mod = LayerModule()

Callers

nothing calls this directly

Calls 2

SimpleModuleClass · 0.85
_flattenMethod · 0.45

Tested by

no test coverage detected