Skip to content

Commit

Permalink
Remove in-place operation
Browse files Browse the repository at this point in the history
  • Loading branch information
runame committed Dec 7, 2023
1 parent eff374c commit ece090b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion algorithmic_efficiency/workloads/wmt/wmt_pytorch/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ def forward(self,
dropout_rate = self.dropout if self.training else 0.0

# Calculate attention.
q.mul_(self.attention_temp)
q = self.attention_temp * q
attn_output = torch.nn.functional.scaled_dot_product_attention(
q, k, v, attn_mask, dropout_rate)
# Rearrange for output projection.
Expand Down

0 comments on commit ece090b

Please sign in to comment.