We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ae3f44 commit 3c7822cCopy full SHA for 3c7822c
timm/models/deit.py
@@ -75,9 +75,11 @@ def set_distilled_training(self, enable=True):
75
def _pos_embed(self, x):
76
if self.dynamic_img_size:
77
B, H, W, C = x.shape
78
+ prev_grid_size = self.patch_embed.grid_size
79
pos_embed = resample_abs_pos_embed(
80
self.pos_embed,
- (H, W),
81
+ new_size=(H, W),
82
+ old_size=prev_grid_size,
83
num_prefix_tokens=0 if self.no_embed_class else self.num_prefix_tokens,
84
)
85
x = x.view(B, -1, C)
0 commit comments