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

Method test_multiply

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

Source from the content-addressed store, hash-verified

51 np.testing.assert_allclose(out, expected, atol=1e-2)
52
53 def test_multiply(self):
54 g = Graph()
55 a = g.input((4,))
56 b = g.input((4,))
57 y = a * b
58
59 g.set_input(a, np.array([2, 3, 4, 5], dtype=np.float16))
60 g.set_input(b, np.array([3, 4, 5, 6], dtype=np.float16))
61 g.execute()
62
63 out = y.numpy()
64 expected = np.array([6, 12, 20, 30], dtype=np.float16)
65 np.testing.assert_allclose(out, expected, atol=1e-2)
66
67 def test_divide(self):
68 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