(target, dev, binary_minmax_op_func)
| 254 | |
| 255 | @tvm.testing.parametrize_targets("llvm") |
| 256 | def test_binary_minmax(target, dev, binary_minmax_op_func): |
| 257 | # Checking numerical gradient of min and max requires data1_numpy[i] != data2_numpy[i] |
| 258 | # for all possible i. |
| 259 | # If data1_numpy[i] == data2_numpy[i], the operator is not differentiable w.r.t. place i |
| 260 | data1_numpy = np.random.uniform(1, 1.1, (3, 3)).astype(np.float32) |
| 261 | delta = np.random.uniform(1, 1.1, (3, 3)).astype(np.float32) |
| 262 | sign = np.random.randint(0, 2, (3, 3)).astype(np.float32) * 2 - 1 |
| 263 | data2_numpy = data1_numpy + delta * sign |
| 264 | relax_check_gradients(binary_minmax_op_func, [data1_numpy, data2_numpy], target, dev) |
| 265 | |
| 266 | |
| 267 | (binary_cmp_op_func,) = tvm.testing.parameters( |
nothing calls this directly
no test coverage detected
searching dependent graphs…