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

Method comparison_fn

axlearn/experiments/test_utils.py:503–518  ·  view source on GitHub ↗
(actual_result: bytes, golden_result: bytes)

Source from the content-addressed store, hash-verified

501 gc.collect()
502
503 def comparison_fn(actual_result: bytes, golden_result: bytes):
504 actual_run_values = pickle.loads(actual_result)
505 golden_run_values = pickle.loads(golden_result)
506 self.assertNestedEqual(
507 actual_run_values["inputs"], golden_run_values["inputs"]
508 )
509 self.assertNestedAllClose(
510 actual_run_values["trainer_state"],
511 golden_run_values["trainer_state"],
512 rtol=5e-6,
513 atol=0,
514 )
515 self.assertNestedEqual(
516 actual_run_values["trainer_state_specs"],
517 golden_run_values["trainer_state_specs"],
518 )
519
520 return result, comparison_fn
521

Callers

nothing calls this directly

Calls 2

assertNestedEqualMethod · 0.80
assertNestedAllCloseMethod · 0.80

Tested by

no test coverage detected