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

Method test_flatten

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

Source from the content-addressed store, hash-verified

124 np.testing.assert_allclose(out, expected, atol=1e-2)
125
126 def test_flatten(self):
127 g = Graph()
128 a = g.input((2, 3))
129 y = a.flatten()
130
131 g.set_input(a, np.array([[1, 2, 3], [4, 5, 6]], dtype=np.float16))
132 g.execute()
133
134 out = y.numpy()
135 expected = np.array([1, 2, 3, 4, 5, 6], dtype=np.float16)
136 np.testing.assert_allclose(out, expected, atol=1e-2)
137
138 def test_concat(self):
139 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
flattenMethod · 0.45

Tested by

no test coverage detected