mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-08-29 11:56:08 +00:00
* make embedding fast * jit more, variable shape support * print mem bw
9 lines
206 B
Python
9 lines
206 B
Python
from tinygrad.tensor import Tensor
|
|
from tinygrad.nn import Embedding
|
|
|
|
if __name__ == "__main__":
|
|
vocab_size = 50257
|
|
dim = 128
|
|
test = Embedding(vocab_size, dim)
|
|
ret = test(Tensor([[1,2,3]])).numpy()
|