Skip to content

Commit

Permalink
Fixes Beit training for PyTorch 1.10+ (#14249)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger authored Nov 2, 2021
1 parent ad3e560 commit bbaa3ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/beit/modeling_beit.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ def forward(self, encoder_hidden_states):
used_backbone_levels = len(laterals)
for i in range(used_backbone_levels - 1, 0, -1):
prev_shape = laterals[i - 1].shape[2:]
laterals[i - 1] += nn.functional.interpolate(
laterals[i - 1] = laterals[i - 1] + nn.functional.interpolate(
laterals[i], size=prev_shape, mode="bilinear", align_corners=self.align_corners
)

Expand Down

0 comments on commit bbaa3ef

Please sign in to comment.