From 679ae1d14167541384b4e732f80847e1c5095b19 Mon Sep 17 00:00:00 2001 From: Nathan Harmon Date: Wed, 25 Jun 2025 18:42:09 -0600 Subject: [PATCH] Fix: Ensure DTW cost tensor is on the same device as input tensor (#2561) Co-authored-by: Jong Wook Kim --- whisper/timing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisper/timing.py b/whisper/timing.py index e563414..2340000 100644 --- a/whisper/timing.py +++ b/whisper/timing.py @@ -117,7 +117,7 @@ def dtw_cuda(x, BLOCK_SIZE=1024): x_skew = x_skew.T.contiguous() cost = torch.ones(N + M + 2, M + 2) * np.inf cost[0, 0] = 0 - cost = cost.cuda() + cost = cost.to(x.device) trace = torch.zeros_like(cost, dtype=torch.int32) dtw_kernel[(1,)](