mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "[Easy] Add more check for elapsedTime of torch.xxx.Event and torch.Event (#151404)"
This reverts commit 783be8f93248ca3af24b968bdf84188f5a3257d1. Reverted https://github.com/pytorch/pytorch/pull/151404 on behalf of https://github.com/malfet due to suspected of breaking linux builds and breaks internal tests as well ([comment](https://github.com/pytorch/pytorch/pull/151404#issuecomment-2819041756))
This commit is contained in:
@ -960,22 +960,6 @@ class TestCuda(TestCase):
|
||||
self.assertTrue(event.query())
|
||||
self.assertGreater(start_event.elapsed_time(event), 0)
|
||||
|
||||
def test_events_elapsedtime(self):
|
||||
event1 = torch.cuda.Event(enable_timing=False)
|
||||
event2 = torch.cuda.Event(enable_timing=False)
|
||||
with self.assertRaisesRegex(
|
||||
ValueError, "Both events must be recorded before calculating elapsed time"
|
||||
):
|
||||
event1.elapsed_time(event2)
|
||||
|
||||
event1.record()
|
||||
event2.record()
|
||||
with self.assertRaisesRegex(
|
||||
ValueError,
|
||||
"Both events must be created with argument 'enable_timing=True'",
|
||||
):
|
||||
event1.elapsed_time(event2)
|
||||
|
||||
def test_generic_stream_event(self):
|
||||
stream = torch.Stream("cuda")
|
||||
self.assertEqual(stream.device_index, torch.cuda.current_device())
|
||||
|
Reference in New Issue
Block a user