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

Method test_invalid_op_on_array

python/tests/test_array.py:250–271  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

248 a >= tpl_
249
250 def test_invalid_op_on_array(self):
251 str_ = "hello"
252 a = mx.array([1, 2.5, 3.25])
253 lst_ = [1, 2.1, 3.25]
254 tpl_ = (1, 2.5, 3.25)
255
256 with self.assertRaises(ValueError):
257 a * str_
258 with self.assertRaises(ValueError):
259 a *= str_
260 with self.assertRaises(ValueError):
261 a /= lst_
262 with self.assertRaises(ValueError):
263 a // lst_
264 with self.assertRaises(ValueError):
265 a % lst_
266 with self.assertRaises(ValueError):
267 a**tpl_
268 with self.assertRaises(ValueError):
269 a & tpl_
270 with self.assertRaises(ValueError):
271 a | str_
272
273
274class TestArray(mlx_tests.MLXTestCase):

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected