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

Method test_double_constant

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

Source from the content-addressed store, hash-verified

1045 self.assertEqual(mem_pre, mem_post)
1046
1047 def test_double_constant(self):
1048 with mx.stream(mx.cpu):
1049 x = mx.array(1.0, dtype=mx.float64)
1050
1051 def fun(x):
1052 return (x + math.pi) * 2.0
1053
1054 y = fun(x).item()
1055 y_compiled = mx.compile(fun)(x).item()
1056 self.assertEqual(y, y_compiled)
1057
1058 def test_shared_broadcast(self):
1059 def fun(x, y, z):

Callers

nothing calls this directly

Calls 2

itemMethod · 0.80
arrayMethod · 0.60

Tested by

no test coverage detected