Skip to content

Commit

Permalink
add contiguous to scale too
Browse files Browse the repository at this point in the history
  • Loading branch information
divyashreepathihalli committed Nov 7, 2024
1 parent a36d119 commit 3e34498
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions keras/src/backend/torch/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,8 @@ def dot_product_attention(
else:
if mask is not None:
mask = mask.contiguous()
if scale is not None:
scale = scale.contiguous()
attention_output = torch.nn.functional.scaled_dot_product_attention(
query.contiguous(),
key.contiguous(),
Expand Down

0 comments on commit 3e34498

Please sign in to comment.