Skip to content

Commit 7091904

Browse files
committed
Small fix for unused non-cat RotaryEmbedding module
1 parent 9885d69 commit 7091904

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

timm/layers/pos_embed_sincos.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ def _get_pos_embed_values(self, feat_shape: List[int]):
414414
def update_feat_shape(self, feat_shape: List[int]):
415415
if self.feat_shape is not None and feat_shape != self.feat_shape:
416416
# only update if feat_shape was set and different from previous value
417-
assert self.pos_embed is not None
417+
assert self.pos_embed_sin is not None
418+
assert self.pos_embed_cos is not None
418419
emb_sin, emb_cos = self._get_pos_embed_values(feat_shape)
419420
self.pos_embed_sin = emb_sin.to(self.pos_embed_sin.device, self.pos_embed_sin.dtype)
420421
self.pos_embed_cos = emb_cos.to(self.pos_embed_cos.device, self.pos_embed_cos.dtype)

0 commit comments

Comments
 (0)