axial-positional-embedding
Axial Positional Embedding
Decision gist · record as of 2026-08-14
Yes, if you are building transformer models on multi-dimensional data (images, videos, or structured tensors) and want a lightweight, permissively licensed positional encoding layer. The aging maintenance status is a minor concern for a stable utility, but verify compatibility with your specific PyTorch version. No known vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires torch and einops as runtime dependencies.
- Low install friction with a pure Python wheel.
- Maintenance status is aging—last release was 535 days ago—but the package remains functional with torch and einops.
License · maintenance · safety
permissive license (permissive) — MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2025-02-25 (535 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 84,739 downloads/mo, #13,979 on PyPI
Alternatives
Verify before relying
pip install axial-positional-embedding
import torch
from axial_positional_embedding import AxialPositionalEmbedding
pos_emb = AxialPositionalEmbedding(dim=512, axial_shape=(64, 64), axial_dims=(256, 256))
tokens = torch.randn(1, 1024, 512)
tokens = pos_emb(tokens) + tokens- Whether the package works with recent PyTorch versions beyond current support
- Performance characteristics or benchmarks compared to standard positional encoding
- Active community support or responsiveness to issues given aging maintenance status
What it is and what it does
Axial Positional Embedding implements a specialized form of positional encoding designed for transformer networks working with multi-dimensional data. Instead of encoding position as a single sequence, it decomposes position information across multiple axes—useful for images, videos, or any structured tensor input. The package provides two main variants: a standard AxialPositionalEmbedding that combines embeddings from separate axes, and a ContinuousAxialPositionalEmbedding that uses MLPs for better extrapolation across unseen dimensions.
The package depends on torch for tensor operations and einops for flexible tensor reshaping. It targets developers building attention-based models on non-sequential data, where traditional sequence-based positional encodings are inefficient or inappropriate. The implementation is lightweight and integrates directly into PyTorch models by adding the embedding to token representations.
Use it for
- Encoding position information in vision transformers processing image patches arranged in 2D grids
- Adding positional context to video transformers with temporal and spatial dimensions
- Improving transformer efficiency on multi-dimensional data by factorizing position encoding across axes
- Building language models that benefit from axial decomposition of sequence positions
- Extending transformers to handle variable-sized multi-dimensional inputs with better generalization
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building transformer models on multi-dimensional data (images, videos, or structured tensors) and want a lightweight, permissively licensed positional encoding layer.
The aging maintenance status is a minor concern for a stable utility, but verify compatibility with your specific PyTorch version. No known vulnerabilities.
Install
axial-positional-embedding on PyPI
Before you install
Low install friction with a pure Python wheel. Maintenance status is aging—last release was 535 days ago—but the package remains functional with torch and einops.
Requires torch and einops as runtime dependencies.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install axial-positional-embedding
import torch
from axial_positional_embedding import AxialPositionalEmbedding
pos_emb = AxialPositionalEmbedding(dim=512, axial_shape=(64, 64), axial_dims=(256, 256))
tokens = torch.randn(1, 1024, 512)
tokens = pos_emb(tokens) + tokens
Verify before relying
- Whether the package works with recent PyTorch versions beyond current support
- Performance characteristics or benchmarks compared to standard positional encoding
- Active community support or responsiveness to issues given aging maintenance status
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packageseinopstorch |
| Maintenance | Aging 535 days since the last release |
| First released | |
| Downloads | 84,739 / month, #13,979 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.8Topic :: Scientific/Engineering :: Artificial Intelligence |
Evidence: axial_positional_embedding-0.3.12-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “positional embedding transformer”
- axial-positional-embeddingProvides axial positional embeddings for transformer networks,…
- rotary-embedding-torchImplements rotary positional embeddings for transformer attention…
- transformer-smaller-training-vocabReduces transformer model vocabulary to only tokens used during…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also rotary-embedding-torch · local-attention · mamba-ssm · CoLT5-attention · x-transformers · vit-pytorch · vector-quantize-pytorch · antiberty · compel · einops-exts