Commit ac998eb1 authored by Moto Hira's avatar Moto Hira Committed by Facebook GitHub Bot
Browse files

Fix initialization of HW acceleration (#3209)

Summary:
Pull Request resolved: https://github.com/pytorch/audio/pull/3209

The previous code prints out the uninitialized variable when
invalid HW acceleration is provided.

This commit fixes it.

Reviewed By: hwangjeff

Differential Revision: D44449715

fbshipit-source-id: 8b76cfc27816d5ea9fbc2bc37a3148f09a8ed6ed
parent b1de9f1a
......@@ -306,9 +306,7 @@ void StreamReader::add_video_stream(
#ifdef USE_CUDA
torch::Device d{hw_accel.value()};
TORCH_CHECK(
d.type() == c10::DeviceType::CUDA,
"Only CUDA is supported for hardware acceleration. Found: ",
device.str());
d.is_cuda(), "Only CUDA is supported for HW acceleration. Found: ", d);
return d;
#else
TORCH_CHECK(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment