Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SatyaJandhyalaAtMS committed Feb 27, 2023
1 parent f95f60c commit 6e95a10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/swinv2/modeling_swinv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def forward(self, pixel_values: Optional[torch.FloatTensor]) -> Tuple[torch.Tens
pixel_values = self.maybe_pad(pixel_values, height, width)
embeddings = self.projection(pixel_values)
_, _, height, width = embeddings.shape
output_dimensions = (height, width)
output_dimensions = (height.item() if torch.is_tensor(height) else height, width.item() if torch.is_tensor(width) else width)
embeddings = embeddings.flatten(2).transpose(1, 2)

return embeddings, output_dimensions
Expand Down

0 comments on commit 6e95a10

Please sign in to comment.