()
| 28 | test_stream = mx.new_thread_local_stream(mx.default_device()) |
| 29 | |
| 30 | def test_success(): |
| 31 | with mx.stream(test_stream): |
| 32 | x = mx.arange(10) |
| 33 | mx.eval(2 * x) |
| 34 | self.assertEqual(x.tolist(), list(range(10))) |
| 35 | mx.clear_streams() |
| 36 | |
| 37 | t1 = threading.Thread(target=test_success) |
| 38 | t2 = threading.Thread(target=test_success) |