MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_assert

Function test_assert

tests/transforms/test_create_grid_and_affine.py:160–167  ·  view source on GitHub ↗
(func, params, expected)

Source from the content-addressed store, hash-verified

158
159
160def test_assert(func, params, expected):
161 gpu_test = ("torch_gpu",) if torch.cuda.is_available() else ()
162 for b in ("torch", "numpy") + gpu_test:
163 if b == "torch_gpu":
164 m = func(*params, device="cuda:0", backend="torch")
165 else:
166 m = func(*params, backend=b)
167 assert_allclose(m, expected, type_test=False, rtol=1e-2 if is_tf32_env() else 1e-5, atol=1e-5)
168
169
170class TestCreateAffine(unittest.TestCase):

Callers 6

test_create_gridMethod · 0.85
test_create_rotateMethod · 0.85
test_create_shearMethod · 0.85
test_create_scaleMethod · 0.85
test_create_translateMethod · 0.85

Calls 2

assert_allcloseFunction · 0.90
is_tf32_envFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…