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

Method test_cos

python/tests/test_ops.py:1032–1039  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1030 self.assertTrue(np.allclose(result, expected))
1031
1032 def test_cos(self):
1033 a = mx.array(
1034 [0, math.pi / 4, math.pi / 2, math.pi, 3 * math.pi / 4, 2 * math.pi]
1035 )
1036 result = mx.cos(a)
1037 expected = np.cos(a, dtype=np.float32)
1038
1039 self.assertTrue(np.allclose(result, expected))
1040
1041 def test_degrees(self):
1042 a = mx.array(

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected