Skip to content

Commit

Permalink
softmax after kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Oct 3, 2023
1 parent 8f9e005 commit 5e8e1ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mega_vit/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def forward(self, x):
with torch.backends.cuda.sdp_kernel(enable_math=True):
#attention
out = F.scaled_dot_product_attention(q, k, v)

#softmax
out = self.attend(out)

#dropout
out = self.dropout(out)
Expand Down

0 comments on commit 5e8e1ed

Please sign in to comment.