This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 680f32c4c9 avfilter/dnn: add PyTorch version check for XPU
initialization in torch backend
680f32c4c9 is described below
commit 680f32c4c9beaacf70e5ca86fc35b5e5119370f5
Author: stevxiao <[email protected]>
AuthorDate: Fri Feb 6 13:01:26 2026 -0500
Commit: stevxiao <[email protected]>
CommitDate: Thu Feb 12 10:48:58 2026 -0500
avfilter/dnn: add PyTorch version check for XPU initialization in torch
backend
Starting with PyTorch 2.6, the hooks API was redesigned so it no longer
depends on the device type.
As part of this change, the XPU initialization function was renamed from
initXPU() to init().
Add version check to support both old and new LibTorch versions.
Signed-off-by: younengxiao <[email protected]>
---
libavfilter/dnn/dnn_backend_torch.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavfilter/dnn/dnn_backend_torch.cpp
b/libavfilter/dnn/dnn_backend_torch.cpp
index 56fbe372d1..d3c4966c09 100644
--- a/libavfilter/dnn/dnn_backend_torch.cpp
+++ b/libavfilter/dnn/dnn_backend_torch.cpp
@@ -515,7 +515,11 @@ static DNNModel *dnn_load_model_th(DnnContext *ctx,
DNNFunctionType func_type, A
av_log(ctx, AV_LOG_ERROR, "No XPU device found\n");
goto fail;
}
+#if TORCH_VERSION_MAJOR > 2 || (TORCH_VERSION_MAJOR == 2 &&
TORCH_VERSION_MINOR >= 6)
+ at::detail::getXPUHooks().init();
+#else
at::detail::getXPUHooks().initXPU();
+#endif
} else if (!device.is_cpu()) {
av_log(ctx, AV_LOG_ERROR, "Not supported device:\"%s\"\n",
device_name);
goto fail;
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]