Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Position embedding implemented in PyTorch

Project description

PyTorch Position Embedding

Travis Coverage

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for torch-position-embedding, version 0.7.1
Filename, size File type Python version Upload date Hashes
Filename, size torch-position-embedding-0.7.1.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page