|
10 | 10 | #include <string> |
11 | 11 | #include "c10/core/SymIntArrayRef.h" |
12 | 12 | #include "c10/util/Exception.h" |
13 | | -#include "torch/library.h" |
14 | 13 | #include "src/torchcodec/_core/AVIOFileLikeContext.h" |
15 | 14 | #include "src/torchcodec/_core/AVIOTensorContext.h" |
16 | 15 | #include "src/torchcodec/_core/Encoder.h" |
17 | 16 | #include "src/torchcodec/_core/SingleStreamDecoder.h" |
18 | 17 | #include "src/torchcodec/_core/ValidationUtils.h" |
| 18 | +#include "torch/library.h" |
19 | 19 |
|
20 | 20 | namespace facebook::torchcodec { |
21 | 21 |
|
@@ -118,7 +118,7 @@ OpsFrameOutput makeOpsFrameOutput(FrameOutput& frame) { |
118 | 118 | // frame.data, |
119 | 119 | // torch::tensor(frame.ptsSeconds, torch::dtype(torch::kFloat64)), |
120 | 120 | // torch::tensor(frame.durationSeconds, torch::dtype(torch::kFloat64))); |
121 | | - return std::make_tuple( |
| 121 | + return std::make_tuple( |
122 | 122 | frame.data, |
123 | 123 | torch::full({}, frame.ptsSeconds, torch::kFloat64), |
124 | 124 | torch::full({}, frame.durationSeconds, torch::kFloat64)); |
@@ -920,15 +920,15 @@ void scan_all_streams_to_update_metadata(at::Tensor& decoder) { |
920 | 920 | videoDecoder->scanFileAndUpdateMetadataAndIndex(); |
921 | 921 | } |
922 | 922 |
|
923 | | -TORCH_LIBRARY_IMPL(torchcodec_ns, CPU, m) { |
| 923 | +TORCH_LIBRARY_IMPL(torchcodec_ns, BackendSelect, m) { |
924 | 924 | m.impl("create_from_file", &create_from_file); |
925 | 925 | m.impl("create_from_tensor", &create_from_tensor); |
926 | 926 | m.impl("_create_from_file_like", &_create_from_file_like); |
927 | 927 | m.impl( |
928 | 928 | "_get_json_ffmpeg_library_versions", &_get_json_ffmpeg_library_versions); |
929 | | -// } |
| 929 | +} |
930 | 930 |
|
931 | | -// TORCH_LIBRARY_IMPL(torchcodec_ns, CPU, m) { |
| 931 | +TORCH_LIBRARY_IMPL(torchcodec_ns, CPU, m) { |
932 | 932 | m.impl("encode_audio_to_file", &encode_audio_to_file); |
933 | 933 | m.impl("encode_audio_to_tensor", &encode_audio_to_tensor); |
934 | 934 | m.impl("_encode_audio_to_file_like", &_encode_audio_to_file_like); |
|
0 commit comments