Embedding
A lookup table mapping integer indices to dense vectors.
class Embedding : Module— python/vkml/nn.py:604
Implemented as an index_select over the weight, so its gradient is a scatter_add back into a zero tensor — which is why scatter_add's determinism matters for training a model with an embedding, not only for inference.
Construction¶
__init__¶
Forward¶
forward¶
def forwardself, indices: V.Tensor -> V.Tensor— python/vkml/nn.py:620
Internals¶
__repr__¶
See also index_select, scatter_add, PositionalEncoding, Module