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.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00ba52e6740ca920569f235e87585c896f98fe6c60a7e38748c29290a7fbe402 |
|
MD5 | 48ed1a35a469d9b2bc451bd50455e8cb |
|
BLAKE2b-256 | 5a0f77f7b780ae8c73c8aafc5eac1439472e469618c097e635169cd36c2dc13e |