MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / test_relu

Method test_relu

python/oneflow/test/modules/test_module.py:192–197  ·  view source on GitHub ↗
(test_case)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 4

reluFunction · 0.85
np_reluFunction · 0.85
numpyMethod · 0.80
TensorMethod · 0.45

Tested by

no test coverage detected