MCPcopy Create free account
hub / github.com/cactus-compute/cactus / test_add

Method test_add

python/tests/test_graph.py:39–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 np.testing.assert_allclose(out, expected, atol=1e-2)
38
39 def test_add(self):
40 g = Graph()
41 a = g.input((4,))
42 b = g.input((4,))
43 y = a + b
44
45 g.set_input(a, np.array([1, 2, 3, 4], dtype=np.float16))
46 g.set_input(b, np.array([10, 20, 30, 40], dtype=np.float16))
47 g.execute()
48
49 out = y.numpy()
50 expected = np.array([11, 22, 33, 44], dtype=np.float16)
51 np.testing.assert_allclose(out, expected, atol=1e-2)
52
53 def test_multiply(self):
54 g = Graph()

Callers

nothing calls this directly

Calls 5

inputMethod · 0.95
set_inputMethod · 0.95
executeMethod · 0.95
GraphClass · 0.90
numpyMethod · 0.80

Tested by

no test coverage detected