No project description provided
Project description
Pytorch extension written in rust
A demo pytorch (2.3.0) package using maturin and tch.
Build in a venv
# Create and activate a venv
python -m venv .venv
source .venv/bin/activate
# Install maturin
pip install maturin
# Build the torch_lib_with_rust package with maturin
LIBTORCH_USE_PYTORCH=1 maturin develop
Run
import torch
import torch_lib_with_rust
a=torch.randn(16).to("cuda")
print(a)
print(torch_lib_with_rust.add_one(a))
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
Close
Hashes for torch_lib_with_rust-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c3ee194db19e5e2fc843b6328ff6044d2bfe0058aeba6edd1b43293ad82a71 |
|
MD5 | d3b6e8173437dff117143872ac39e2e3 |
|
BLAKE2b-256 | 41b8e0b07883dec41392e348c37eb28891bd762708e066d4cfa4198f53e3448b |
Close
Hashes for torch_lib_with_rust-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f42a90ff819f465f3d777067ed0ba2020cc69ce33c40839b849d79ed20601cf |
|
MD5 | 62297761d4e7c78ba8e64756a9a4c4c9 |
|
BLAKE2b-256 | 21006197e8fda63225532eecac56dbf677d2380322d46cdb6d278783f615e86c |