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

Method test_negation

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

Source from the content-addressed store, hash-verified

41 assert out[-1] == 2.0 * 999999.0 + 1.0
42
43 def test_negation(self) -> None:
44 x = kernel.arg("x")
45 neg = kernel.elementwise(-x)
46 buf = rt.asarray(np.array([1.0, -2.0, 0.0]))
47 out = rt.go(kernel.map(neg, x=buf)).result().numpy()
48 np.testing.assert_array_equal(out, [-1.0, 2.0, 0.0])
49
50 def test_subtraction(self) -> None:
51 x, y = kernel.args("x", "y")

Callers

nothing calls this directly

Calls 7

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