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

Method test_divide

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

Source from the content-addressed store, hash-verified

65 np.testing.assert_allclose(out, expected, atol=1e-2)
66
67 def test_divide(self):
68 g = Graph()
69 a = g.input((4,))
70 b = g.input((4,))
71 y = a / b
72
73 g.set_input(a, np.array([10, 20, 30, 40], dtype=np.float16))
74 g.set_input(b, np.array([2, 4, 5, 8], dtype=np.float16))
75 g.execute()
76
77 out = y.numpy()
78 expected = np.array([5, 5, 6, 5], dtype=np.float16)
79 np.testing.assert_allclose(out, expected, atol=1e-2)
80
81
82class TestGraphComposed(unittest.TestCase):

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