generated from kyegomez/Paper-Implementation-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye
committed
Sep 27, 2023
1 parent
5f1d3bd
commit ec5f2ad
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import torch | ||
from mmca.main import SimpleMMCA | ||
|
||
|
||
# Define the dimensions | ||
dim = 512 | ||
head = 8 | ||
seq_len = 10 | ||
batch_size = 32 | ||
|
||
#attn | ||
attn = SimpleMMCA(dim=dim, heads=head) | ||
|
||
#random tokens | ||
v = torch.randn(batch_size, seq_len, dim) | ||
t = torch.randn(batch_size, seq_len, dim) | ||
|
||
#pass the tokens throught attn | ||
tokens = attn(v, t) | ||
|
||
print(tokens) |