torch-complex
A fugacious python class for PyTorch-ComplexTensor
Decision gist · record as of 2026-08-14
No. The package is dormant and explicitly positioned as a temporary workaround. PyTorch has since added native ComplexTensor support, making this wrapper unnecessary for modern projects. Install only if you are locked into an old PyTorch version that lacks complex tensor support and cannot upgrade.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyTorch 1.0+ and Python 3.6+; performance is poor because all operations are implemented in Python rather than at the C++ level.
- Low install friction with only packaging and numpy as runtime dependencies.
- Package is dormant (777 days since last release) but marked Production/Stable; use only if you accept no active maintenance.
License · maintenance · safety
permissive license (permissive) — Licensed under Apache Software License (permissive), imposing no significant restrictions on use or modification.
last release 2024-06-28 (777 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 413,667 downloads/mo, #6,840 on PyPI
Alternatives
Verify before relying
pip install torch_complex
from torch_complex.tensor import ComplexTensor
import numpy as np
real = np.random.randn(3, 10, 10)
imag = np.random.randn(3, 10, 10)
x = ComplexTensor(real, imag)
result = x + x- Whether PyTorch has since added native ComplexTensor support that would make this package obsolete.
- Performance characteristics compared to native PyTorch operations or alternative complex tensor libraries.
- Compatibility with recent PyTorch versions beyond those listed in classifiers.
What it is and what it does
torch_complex is a thin wrapper that simulates PyTorch's missing ComplexTensor type by pairing real and imaginary torch.Tensor objects. It implements basic arithmetic (addition, multiplication, division, exponentiation), matrix operations (batch matmul, batch inverse, conjugate), and functional operations (cat, stack, einsum) on complex values. The package also supports GPU operations (cuda/cpu) and autograd backpropagation.
The author explicitly describes this as a temporary workaround for PyTorch's lack of native complex tensor support at the Python level, intending to deprecate it once PyTorch adds the feature. All operations are implemented by composing real-valued PyTorch operations at the Python level, so performance is not optimized. It requires Python 3.6+ and PyTorch 1.0+.
Use it for
- Prototyping signal processing or Fourier-domain neural networks when native PyTorch complex support is unavailable.
- Implementing complex-valued layers in deep learning models that require complex arithmetic.
- Performing batch matrix operations on complex-valued data (matmul, inverse, einsum).
- Training models with complex-valued activations or loss functions using autograd.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No.
The package is dormant and explicitly positioned as a temporary workaround. PyTorch has since added native ComplexTensor support, making this wrapper unnecessary for modern projects. Install only if you are locked into an old PyTorch version that lacks complex tensor support and cannot upgrade.
Install
torch-complex on PyPI
Before you install
Low install friction with only packaging and numpy as runtime dependencies. Package is dormant (777 days since last release) but marked Production/Stable; use only if you accept no active maintenance.
Requires PyTorch 1.0+ and Python 3.6+; performance is poor because all operations are implemented in Python rather than at the C++ level.
License in practice
Licensed under Apache Software License (permissive), imposing no significant restrictions on use or modification.
Quickstart
pip install torch_complex
from torch_complex.tensor import ComplexTensor
import numpy as np
real = np.random.randn(3, 10, 10)
imag = np.random.randn(3, 10, 10)
x = ComplexTensor(real, imag)
result = x + x
Verify before relying
- Whether PyTorch has since added native ComplexTensor support that would make this package obsolete.
- Performance characteristics compared to native PyTorch operations or alternative complex tensor libraries.
- Compatibility with recent PyTorch versions beyond those listed in classifiers.
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespackagingnumpy |
| Maintenance | Dormant 777 days since the last release |
| First released | |
| Downloads | 413,667 / month, #6,840 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Libraries :: Python Modules |
Evidence: torch_complex-0.4.4-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 › “complex tensor pytorch”
- torch-complexProvides a Python class wrapping real and imaginary PyTorch tensors…
- opt-einsum-fxOptimizes PyTorch einsum operations and functions containing them by…
- einxeinx provides a universal notation for expressing tensor operations…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also torch · pytorch-forecasting · torch-geometric · torch-einops-utils · torchtyping · tensorly · tensordict · pytorchcv · linear-operator · e3nn