call cuda function

This commit is contained in:
Soham
2023-04-13 11:53:23 -07:00
committed by GitHub
parent ebdb895b4b
commit cf7b4288af
+1 -1
View File
@@ -149,7 +149,7 @@ class CLAPWrapper():
audio_tensor = self.load_audio_into_tensor( audio_tensor = self.load_audio_into_tensor(
audio_file, self.args.duration, resample) audio_file, self.args.duration, resample)
audio_tensor = audio_tensor.reshape( audio_tensor = audio_tensor.reshape(
1, -1).cuda if self.use_cuda and torch.cuda.is_available() else audio_tensor.reshape(1, -1) 1, -1).cuda() if self.use_cuda and torch.cuda.is_available() else audio_tensor.reshape(1, -1)
audio_tensors.append(audio_tensor) audio_tensors.append(audio_tensor)
return self.default_collate(audio_tensors) return self.default_collate(audio_tensors)