Skip to content

Commit d06f5e8

Browse files
committed
fix torchscript complaint
1 parent 7fd7206 commit d06f5e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timm/models/swin_transformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def get_attn_mask(self, x: Optional[torch.Tensor] = None) -> Optional[torch.Tens
291291
dtype = x.dtype
292292
else:
293293
H, W = self.input_resolution
294-
device = "cpu"
294+
device = torch.device("cpu")
295295
dtype = None
296296
H = math.ceil(H / self.window_size[0]) * self.window_size[0]
297297
W = math.ceil(W / self.window_size[1]) * self.window_size[1]

0 commit comments

Comments
 (0)