Skip to content

Commit

Permalink
Update vision_transformer.py (#331)
Browse files Browse the repository at this point in the history
Account for register tokens in get_intermediate_layers
  • Loading branch information
qasfb committed Dec 1, 2023
1 parent da4b382 commit 2302b6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dinov2/models/vision_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def get_intermediate_layers(
if norm:
outputs = [self.norm(out) for out in outputs]
class_tokens = [out[:, 0] for out in outputs]
outputs = [out[:, 1:] for out in outputs]
outputs = [out[:, 1 + self.num_register_tokens:] for out in outputs]
if reshape:
B, _, w, h = x.shape
outputs = [
Expand Down

0 comments on commit 2302b6b

Please sign in to comment.