MCPcopy Create free account
hub / github.com/ml-explore/mlx / test_function_creates_array

Method test_function_creates_array

python/tests/test_compile.py:160–170  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

158 self.assertEqual(out.item(), 4)
159
160 def test_function_creates_array(self):
161 def fun(x):
162 return x + mx.array(1)
163
164 cfun = mx.compile(fun)
165 out = cfun(mx.array(3))
166 self.assertEqual(out.item(), 4)
167
168 # And again
169 out = cfun(mx.array(3))
170 self.assertEqual(out.item(), 4)
171
172 def test_enable_disable(self):
173 def fun(x):

Callers

nothing calls this directly

Calls 2

itemMethod · 0.80
arrayMethod · 0.60

Tested by

no test coverage detected