Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/test_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def forward(self, x):
actual = m_jitted(x)

# assert
torch.testing.assert_allclose(actual, expected)
torch.testing.assert_close(actual, expected)

# arrange
# make sure buffer donation works
Expand All @@ -139,7 +139,7 @@ def forward(self, x):
# act
actual = functional_forward(m_jitted.params, m_jitted.buffers, x)
# assert
torch.testing.assert_allclose(actual, expected)
torch.testing.assert_close(actual, expected)

def test_to_jax_device(self):
a = torch.ones(3, 3)
Expand Down
4 changes: 3 additions & 1 deletion test/test_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def test_scan_module(self):
x = x.to("jax")
model.to("jax")
result2 = model(x)
torch.testing.assert_allclose(result, result2.to("cpu"))
# Explicit rtol/atol match previous assert_allclose's defaults for float32 (1e-4 / 1e-5)
# to accommodate small numerical drift accumulating from eager loop vs ScannedModule executions.
torch.testing.assert_close(result, result2.to("cpu"), rtol=1e-4, atol=1e-5)

def test_train_step_can_run(self):
import optax
Expand Down