MCPcopy Index your code
hub / github.com/YuminosukeSato/ironkernel / test_relu

Method test_relu

tests/python/test_kernel.py:103–108  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101
102class TestWhere:
103 def test_relu(self) -> None:
104 x = kernel.arg("x")
105 relu = kernel.elementwise(kernel.where(x > 0, x, 0))
106 data = rt.asarray(np.array([-2.0, -1.0, 0.0, 1.0, 2.0]))
107 out = rt.go(kernel.map(relu, x=data)).result().numpy()
108 np.testing.assert_array_equal(out, [0.0, 0.0, 0.0, 1.0, 2.0])
109
110
111class TestReduce:

Callers

nothing calls this directly

Calls 8

whereMethod · 0.80
numpyMethod · 0.80
argMethod · 0.45
elementwiseMethod · 0.45
asarrayMethod · 0.45
resultMethod · 0.45
goMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected