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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | abab619aae87e56f3e83150a525562a486e33becc0823321674be0dbe5519ee3 |
|
MD5 | 1c2437d6eabd40242de86a1224b498bd |
|
BLAKE2b-256 | 6a789e34e7ded9b102404b8a9452bf95478eeb3fa2a3f8fa733ab9c25a07fb5e |