MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / torch_assert_equal

Function torch_assert_equal

tests/unit/util.py:129–134  ·  view source on GitHub ↗

Compare two tensors or non-tensor numbers for their equality. Add msg=blah to add an additional comment to when assert fails.

(actual, expected, **kwargs)

Source from the content-addressed store, hash-verified

127
128
129def torch_assert_equal(actual, expected, **kwargs) -> None:
130 """
131 Compare two tensors or non-tensor numbers for their equality.
132 Add msg=blah to add an additional comment to when assert fails.
133 """
134 torch.testing.assert_close(actual, expected, rtol=0.0, atol=0.0, **kwargs)
135
136
137def torch_assert_close(actual, expected, **kwargs) -> None:

Callers 3

test_ulysses_sp_hfMethod · 0.90
test_disable_in_evalMethod · 0.90
test_tiled_mlpMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_ulysses_sp_hfMethod · 0.72
test_disable_in_evalMethod · 0.72
test_tiled_mlpMethod · 0.72