Multi-dimensional tensor library with custom C/C++ backend and Python frontend
Project description
Axon
Lightweight multi-dimensional array manipulation library powered by GPU, similar to NumPy, but trying to be better.
Features
- Custom
arrayclass with Pythonic syntax - Element-wise arithmetic:
+,-,-,/ - Scalar operations (e.g.,
array + 5) - Trigonometric functions:
sin,cos,tan, etc. - Auto handling of
CArray, scalars, and lists - Simple
__str__/__repr__for pretty printing - Reshape, transpose, flatten
- Data type conversion
Requirements
- Python 3.7+
- C compiler (for building the C backend)
- ctypes module (standard in Python)
Getting Started
Build
To use Axon, make sure you have compiled the C backend to a shared library (.dll, .so, or .dylib) and exposed the C functions via ctypes.
Place the compiled .dll (on Windows) or .so (Linux/macOS) in your axon/ folder.
Example
Here's a quick demo of how Axon works:
import axon
from axon import array
# Create two 2D arrays
a = array([[1, 2], [3, 4]], dtype=axon.int32)
b = array([[5, 6], [7, 8]], dtype=axon.int32)
# Addition
c = a + b
print("Addition:\n", c)
# Multiplication
d = a * b
print("Multiplication:\n", d)
# Matrix Multiplication
e = a @ b
print("Matrix Multiplication:\n", e)
Output
Addition:
array([6, 8], [10, 12], dtype=int32)
Multiplication:
array([5, 12], [21, 32], dtype=int32)
Matrix Multiplication:
array([19, 22], [43, 50], dtype=int32)
anyway, prefer documentation for detailed usage guide:
- usage.md: for user guide & documentation
- technical.md: for contirbutors & contirbution related guide
License
This project is under the Apache-2.0 License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file axon_pypi-0.0.1.tar.gz.
File metadata
- Download URL: axon_pypi-0.0.1.tar.gz
- Upload date:
- Size: 270.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38c942736b72118a2b43d724937332661fab814f57884cbe6d96694f61ac2698
|
|
| MD5 |
27579b841a213486da26c5f86c130ecb
|
|
| BLAKE2b-256 |
01380d3671b1bce3909674783d8069aa8ae87594c9209b1e7da813eaceccb749
|
File details
Details for the file axon_pypi-0.0.1-py3-none-any.whl.
File metadata
- Download URL: axon_pypi-0.0.1-py3-none-any.whl
- Upload date:
- Size: 274.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
490f06e0902c2d1065bb615c667953bb957f767dfe9991418add83b0aa08e5ad
|
|
| MD5 |
ace32e9b464f636cee499461b0b94452
|
|
| BLAKE2b-256 |
7895d1594e51988372358a52dd5b78602f309b54850529a0d5c5e5fb13a8f39a
|