Skip to content

Commit f57fc00

Browse files
committed
Remove converting int to decoder
1 parent 2828dc5 commit f57fc00

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

src/torchcodec/_core/custom_ops.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ TORCH_LIBRARY(torchcodec_ns, m) {
4040
"create_from_tensor(Tensor video_tensor, str? seek_mode=None) -> Tensor");
4141
m.def(
4242
"_create_from_file_like(int file_like_context, str? seek_mode=None) -> Tensor");
43-
m.def("_convert_to_tensor(int decoder_ptr) -> Tensor");
4443
m.def(
4544
"_add_video_stream(Tensor(a!) decoder, *, int? width=None, int? height=None, int? num_threads=None, str? dimension_order=None, int? stream_index=None, str? device=None, (Tensor, Tensor, Tensor)? custom_frame_mappings=None, str? color_conversion_library=None) -> ()");
4645
m.def(
@@ -233,12 +232,6 @@ at::Tensor _create_from_file_like(
233232
return wrapDecoderPointerToTensor(std::move(uniqueDecoder));
234233
}
235234

236-
at::Tensor _convert_to_tensor(int64_t decoder_ptr) {
237-
auto decoder = reinterpret_cast<SingleStreamDecoder*>(decoder_ptr);
238-
std::unique_ptr<SingleStreamDecoder> uniqueDecoder(decoder);
239-
return wrapDecoderPointerToTensor(std::move(uniqueDecoder));
240-
}
241-
242235
void _add_video_stream(
243236
at::Tensor& decoder,
244237
std::optional<int64_t> width = std::nullopt,
@@ -748,7 +741,6 @@ TORCH_LIBRARY_IMPL(torchcodec_ns, BackendSelect, m) {
748741
m.impl("create_from_file", &create_from_file);
749742
m.impl("create_from_tensor", &create_from_tensor);
750743
m.impl("_create_from_file_like", &_create_from_file_like);
751-
m.impl("_convert_to_tensor", &_convert_to_tensor);
752744
m.impl(
753745
"_get_json_ffmpeg_library_versions", &_get_json_ffmpeg_library_versions);
754746
}

src/torchcodec/_core/ops.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ def load_torchcodec_shared_libraries():
104104
_create_from_file_like = torch._dynamo.disallow_in_graph(
105105
torch.ops.torchcodec_ns._create_from_file_like.default
106106
)
107-
_convert_to_tensor = torch._dynamo.disallow_in_graph(
108-
torch.ops.torchcodec_ns._convert_to_tensor.default
109-
)
110107
add_video_stream = torch.ops.torchcodec_ns.add_video_stream.default
111108
_add_video_stream = torch.ops.torchcodec_ns._add_video_stream.default
112109
add_audio_stream = torch.ops.torchcodec_ns.add_audio_stream.default
@@ -257,11 +254,6 @@ def create_from_tensor_abstract(
257254
return torch.empty([], dtype=torch.long)
258255

259256

260-
@register_fake("torchcodec_ns::_convert_to_tensor")
261-
def _convert_to_tensor_abstract(decoder_ptr: int) -> torch.Tensor:
262-
return torch.empty([], dtype=torch.long)
263-
264-
265257
@register_fake("torchcodec_ns::_add_video_stream")
266258
def _add_video_stream_abstract(
267259
decoder: torch.Tensor,

0 commit comments

Comments
 (0)