Python bindings for the Tensor-library
Project description
tensorx-python
Python bindings for the Tensor-library
- C++20
- CMake
- Python3
- pybind11
- scikit-build-core
Example:
import tensorx
print(tensorx)
import tensorx._tensorx
print(tensorx._tensorx)
print("add_ints:", tensorx.add_ints(2, 3))
print("make_tensor:")
tensorx.make_tensor()
t0 = tensorx.Tensor()
print("t0.rank:", t0.rank, "t0.dims:", t0.dims, "t0.length:", t0.length)
print("t0:", t0)
s = tensorx.scalar(3.14)
print("s:", s)
print("s.rank:", s.rank, "s.dims:", s.dims, "s.length:", s.length)
print("s.get:", s.get()) # 3.14
s.set(2.71)
print("s.set(2.71)->s.get:", s.get()) # 2.71
t1 = tensorx.Tensor(2, (2, 3))
print("t1.rank:", t1.rank, "t1.dims:", t1.dims, "t1.length:", t1.length)
print("t1:", t1)
t2 = tensorx.Tensor(2, 3, 4)
print("t2.rank:", t2.rank, "t2.dims:", t2.dims, "t2.length:", t2.length)
print("t2:", t2)
v = tensorx.from_list([1, 2, 3])
print("v:", v)
m = tensorx.from_list([
[1,2,3],
[4,5,6],
[7,8,9]
])
print("m:", m)
print("m.rank:", m.rank, "m.dims:", m.dims, "m.length:", m.length)
print("m.get(1, 1):", m.get(1, 1))
Add Tensor-library:
git submodule add -b c++mappings git@github.com:alarxx/Tensor-library.git
Install Docker: Root:
apt install docker.io
sudo systemctl enable docker # autostart
sudo systemctl start docker
sudo systemctl status docker
sudo usermod -aG docker $USER
User:
su -c "sudo usermod -aG docker $USER"
newgrp docker
docker version
docker ps
apt install python3 python3-full python3-pip python3-venv
#sudo apt install python3.8
python3 --version
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -m pip install -U twine
python -m pip install -U cibuildwheel
Build with hatchling vs. scikit_build_core (CMake).
Generating distribution archives from pyproject.toml file with configuration metadata:
python -m build
.tar.gz- source distribution.whl- built distribution
Try to install locally:
python -m pip install --force-reinstall dist/*.whl
--force-reinstall- if version didn't change
Uninstall local tensorx-python:
python -m pip uninstall tensorx-python
Inside tensorx/ should be shared libraries (.so)
unzip -l dist/*.whl
Cross-platform build:
cibuildwheel --output-dir dist
Upload to PyPI:
python -m twine upload dist/*
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 tensorx_python-0.0.3-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tensorx_python-0.0.3-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.14t, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57f2d7db3f811bbf88fa887cb49efdd3ce53f79b1c74dd8ec3ff3a38cd4bf990
|
|
| MD5 |
2b62d6509f80d9763b6dea4522033c27
|
|
| BLAKE2b-256 |
92e0e310734808fd8f7089a0f11d6491c5cfbd935de40004b92d74d9f30b80dd
|
File details
Details for the file tensorx_python-0.0.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tensorx_python-0.0.3-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.14, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c946e49c7e7bce3ad2a967437c631e019fc53d31cab8f7b94ead5c85c411e561
|
|
| MD5 |
e5fa69b39f0d0eb695a6217170515994
|
|
| BLAKE2b-256 |
42d949c20ce06aa7aa1dded252f2b28f5381ec7651c374be07abd6c4b546fa7b
|
File details
Details for the file tensorx_python-0.0.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tensorx_python-0.0.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e1ac7cfac57d2d77b055ccb469e62fdb81c4263668ccac46f6ddb1f3b4c0af6
|
|
| MD5 |
eea8d47a5a6d6fefff32f56814df4fbb
|
|
| BLAKE2b-256 |
c448a6af4cad5dc6a742b0dedabe39133b9f02bf8a5ed2fa3b8bdd62f7dce056
|
File details
Details for the file tensorx_python-0.0.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tensorx_python-0.0.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6e7ca3a068cc5b19c13b4592beff5e5ab7be6781589027c49cb674b2b7e85fd
|
|
| MD5 |
b91ea7659bcedf2d83e30adc867c264f
|
|
| BLAKE2b-256 |
f9376054846fd6e1af2bb69a12baddb63d88ec6d64cce6f1efc4c6f8b351f1f4
|
File details
Details for the file tensorx_python-0.0.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tensorx_python-0.0.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a33253fbd0b9452f79ad519192edf81019694e78a7f9ff32f342158e47cf43e
|
|
| MD5 |
c61fe2571fafac604fa7a01354e39919
|
|
| BLAKE2b-256 |
035358e2f184b32f70a609edc026a89fbd362fb1294365a2a1cab20922df2a72
|
File details
Details for the file tensorx_python-0.0.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tensorx_python-0.0.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9675ed38cf38c405a76bbafb27b0b6d0e5d95b1388889dd6e3a4d68a39c1c94
|
|
| MD5 |
fe87eacef11a92c9dc947e17f97f80b6
|
|
| BLAKE2b-256 |
91ada05576c86fc587ce350a5475c11a3465d7865fc18694249519888233f24f
|
File details
Details for the file tensorx_python-0.0.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tensorx_python-0.0.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2559cedcae1b3acdb2103b6635b253fb5da513c8fea287d375315af24214cfab
|
|
| MD5 |
3dc736d59cfec1fb27886271a6d24519
|
|
| BLAKE2b-256 |
26575ab2c2f04c3c66114d466e33a34d691c62ac25db27871e735af0d0d85885
|