diff --git a/c10/cuda/CUDAStream.cpp b/c10/cuda/CUDAStream.cpp index 0cde2d9de01..8eca673cd3a 100644 --- a/c10/cuda/CUDAStream.cpp +++ b/c10/cuda/CUDAStream.cpp @@ -216,9 +216,6 @@ static void initSingleStream(int p, DeviceIndex device_index, int i) { // Creates the low and high priority stream pools for the specified device // Warning: only call once per device! static void initDeviceStreamState(DeviceIndex device_index) { - // Switches to the requested device so streams are properly associated - // with it. - CUDAGuard device_guard{device_index}; for (const auto i : c10::irange(kStreamsPerPool)) { for (const auto p : c10::irange(max_stream_priorities)) { initSingleStream(p, device_index, i);