()
| 12 | test_stream = mx.new_stream(mx.default_device()) |
| 13 | |
| 14 | def test_failure(): |
| 15 | with self.assertRaises(RuntimeError): |
| 16 | with mx.stream(test_stream): |
| 17 | x = mx.arange(10) |
| 18 | mx.eval(2 * x) |
| 19 | mx.clear_streams() |
| 20 | |
| 21 | t1 = threading.Thread(target=test_failure) |
| 22 | t2 = threading.Thread(target=test_failure) |