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

Method test_concat

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

Source from the content-addressed store, hash-verified

136 np.testing.assert_allclose(out, expected, atol=1e-2)
137
138 def test_concat(self):
139 g = Graph()
140 a = g.input((2, 2))
141 b = g.input((2, 2))
142 y = a.concat(b, axis=0)
143
144 g.set_input(a, np.array([[1, 2], [3, 4]], dtype=np.float16))
145 g.set_input(b, np.array([[5, 6], [7, 8]], dtype=np.float16))
146 g.execute()
147
148 out = y.numpy()
149 expected = np.array([[1, 2], [3, 4], [5, 6], [7, 8]], dtype=np.float16)
150 np.testing.assert_allclose(out, expected, atol=1e-2)
151
152 def test_cat_1d(self):
153 g = Graph()

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected