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

Method test_binary_ops

python/tests/test_bf16.py:114–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

112 self.__default_test(op, np_args)
113
114 def test_binary_ops(self):
115 x = np.random.rand(18, 28, 38)
116 y = np.random.rand(18, 28, 38)
117 for op in ["add", "subtract", "multiply", "divide", "maximum", "minimum"]:
118 with self.subTest(op=op):
119 np_args = (
120 x.astype(np.float32),
121 y.astype(np.float32),
122 )
123 self.__default_test(op, np_args, simple_transform=lambda x: x)
124 self.__default_test(op, np_args, simple_transform=lambda x: x[:1])
125 self.__default_test(op, np_args, simple_transform=lambda x: x[:, :1])
126
127 def test_reduction_ops(self):
128 x = np.random.rand(18, 28, 38).astype(np.float32)

Callers

nothing calls this directly

Calls 2

__default_testMethod · 0.95
randMethod · 0.80

Tested by

no test coverage detected