Position embedding implemented in PyTorch
Project description
PyTorch Position Embedding
Install
pip install torch-position-embedding
Usage
from torch_position-embedding import PositionEmbedding
PositionEmbedding(num_embeddings=5, embedding_dim=10, mode=PositionEmbedding.MODE_ADD)
Modes:
MODE_EXPAND
: negative indices could be used to represent relative positions.MODE_ADD
: add position embedding to the original tensor.MODE_CAT
: concatenate position embedding to the original tensor.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for torch-position-embedding-0.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81238eb7234584b33193df9e7942585fa72b9fcfad28e5e4c77a41bb5b7e3c8d |
|
MD5 | 65813f6166fffbcf1a859e16a90123b3 |
|
BLAKE2b-256 | 47264dbe03bb8c5ec58acc43c4547a7bd3651ec9f4440798380af10c9799a39a |