Skip to content

Commit c7c1b3d

Browse files
authored
Fix .reshape(...) in GaudiCLIPAttention (#2338)
1 parent dac60e7 commit c7c1b3d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

optimum/habana/transformers/models/clip/modeling_clip.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,8 @@ def forward(
132132

133133
attn_output = self.bmm2(attn_weights, values)
134134

135-
# attn_output = attn_output.view(bsz, self.num_heads, tgt_len, self.head_dim)
136135
attn_output = attn_output.transpose(1, 2).contiguous()
137-
138-
attn_output = attn_output.reshape(batch_size, seq_length, embed_dim).contiguous()
136+
attn_output = attn_output.reshape(batch_size, seq_length, -1).contiguous()
139137
attn_output = self.out_proj(attn_output)
140138

141139
if not output_attentions:

0 commit comments

Comments
 (0)