MCPcopy Create free account
hub / github.com/apple/axlearn / test_none_prng_key

Method test_none_prng_key

axlearn/common/module_test.py:235–249  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

233 self.assertEqual(xs, {1, 2})
234
235 def test_none_prng_key(self):
236 module1 = _new_module("test1")
237 module2 = _new_module("test2")
238 context1 = InvocationContext(
239 name="context1",
240 parent=None,
241 module=module1,
242 prng_key=None,
243 is_training=True,
244 state={"x": 1},
245 output_collection=new_output_collection(),
246 )
247 with set_current_context(context1):
248 context2 = context1.add_child("context2", module=module2, state={"x": 2})
249 self.assertEqual(context2.prng_key, None)
250
251 class MySummary(summary.Summary):
252 val: str

Callers

nothing calls this directly

Calls 5

add_childMethod · 0.95
InvocationContextClass · 0.90
new_output_collectionFunction · 0.90
set_current_contextFunction · 0.90
_new_moduleFunction · 0.85

Tested by

no test coverage detected