(m=1, k=1, n=1, seed=2021)
| 172 | return out |
| 173 | |
| 174 | def test_matmul_scale(m=1, k=1, n=1, seed=2021): |
| 175 | lhs_np, rhs_np, _, scale = gen_matmul_data(seed, m, k, n) |
| 176 | custom_lhs, custom_rhs = Tensor(lhs_np), Tensor(rhs_np) |
| 177 | builtin_lhs, builtin_rhs = Tensor(lhs_np), Tensor(rhs_np) |
| 178 | |
| 179 | custom_func = MatMulScale(scale=scale) |
| 180 | custom_out = custom_func(custom_lhs, custom_rhs) |
| 181 | builtin_out = builtin_func(builtin_lhs, builtin_rhs, scale) |
| 182 | |
| 183 | np.testing.assert_allclose(custom_out, builtin_out, rtol=1e-3, atol=1e-5) |
| 184 | |
| 185 | def test_matmul_scale_trace(m=1, k=1, n=1, seed=2021): |
| 186 | @jit.trace(capture_as_const=True) |
no test coverage detected