Skip to content

Commit

Permalink
use reshape
Browse files Browse the repository at this point in the history
  • Loading branch information
faaany committed Jun 6, 2024
1 parent 752aba6 commit 1ef8d56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/exporters/ipex/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def forward(

sdpa = self.sdpa_with_cache if use_cache else self.sdpa_without_cache
attn_output, past_key_value, attn_weights = sdpa(query, key, value, past_key_value, attention_mask)
attn_output = attn_output.transpose(1, 2).view(bsz, seq_len, self.hidden_size)
attn_output = attn_output.transpose(1, 2).reshape(bsz, seq_len, self.hidden_size)

if hasattr(self, "mha_linear_add"):
attn_output = self.mha_linear_add(attn_output, residual)
Expand Down

0 comments on commit 1ef8d56

Please sign in to comment.