(func, params, expected)
| 158 | |
| 159 | |
| 160 | def 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 | |
| 170 | class TestCreateAffine(unittest.TestCase): |
no test coverage detected
searching dependent graphs…