Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadsharif1 committed Oct 15, 2024
1 parent 82924d2 commit de40d17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/torchcodec/decoders/_core/VideoDecoderOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void _add_video_stream(
if (device.has_value()) {
if (device.value() == "cpu") {
options.device = torch::Device(torch::kCPU);
} else if (device.value().starts_with("cuda")) {
} else if (device.value().rfind("cuda", 0) == 0) { // starts with "cuda"
std::string deviceStr(device.value());
options.device = torch::Device(deviceStr);
} else {
Expand Down

0 comments on commit de40d17

Please sign in to comment.