From b836451d18fd4e84768c141ac0c56d29df7afe07 Mon Sep 17 00:00:00 2001 From: ybh1998 Date: Mon, 24 Feb 2025 16:10:49 +0800 Subject: [PATCH] Fix Backward loop issue on pytorch 2.5 --- torchinterp1d/interp1d.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchinterp1d/interp1d.py b/torchinterp1d/interp1d.py index 059338d..636bc3d 100644 --- a/torchinterp1d/interp1d.py +++ b/torchinterp1d/interp1d.py @@ -147,7 +147,7 @@ def sel(name): ynew = ynew.view(original_xnew_shape) ctx.save_for_backward(ynew, *saved_inputs) - return ynew + return ynew.detach() @staticmethod def backward(ctx, grad_out): @@ -165,4 +165,4 @@ def backward(ctx, grad_out): return (*result,) -interp1d = Interp1d.apply \ No newline at end of file +interp1d = Interp1d.apply