(test_case)
| 190 | |
| 191 | @flow.unittest.skip_unless_1n1d() |
| 192 | def test_relu(test_case): |
| 193 | relu = flow.nn.ReLU() |
| 194 | x = flow.Tensor(2, 3) |
| 195 | flow.nn.init.uniform_(x, a=-1.0, b=1.0) |
| 196 | y = relu(x) |
| 197 | test_case.assertTrue(np.array_equal(np_relu(x.numpy()), y.numpy())) |
| 198 | |
| 199 | @flow.unittest.skip_unless_1n1d() |
| 200 | def test_load_state_dict(test_case): |