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

Method test_degrees

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

Source from the content-addressed store, hash-verified

1039 self.assertTrue(np.allclose(result, expected))
1040
1041 def test_degrees(self):
1042 a = mx.array(
1043 [0, math.pi / 4, math.pi / 2, math.pi, 3 * math.pi / 4, 2 * math.pi]
1044 )
1045 result = mx.degrees(a)
1046 expected = np.degrees(a, dtype=np.float32)
1047
1048 self.assertTrue(np.allclose(result, expected))
1049
1050 def test_radians(self):
1051 a = mx.array([0.0, 45.0, 90.0, 180.0, 270.0, 360.0])

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected