Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_lib_with_rust-0.1.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torch_lib_with_rust-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (329.6 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

File details

Details for the file torch_lib_with_rust-0.1.1.tar.gz.

File metadata

  • Download URL: torch_lib_with_rust-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.6.0

File hashes

Hashes for torch_lib_with_rust-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a1c3ee194db19e5e2fc843b6328ff6044d2bfe0058aeba6edd1b43293ad82a71
MD5 d3b6e8173437dff117143872ac39e2e3
BLAKE2b-256 41b8e0b07883dec41392e348c37eb28891bd762708e066d4cfa4198f53e3448b

See more details on using hashes here.

File details

Details for the file torch_lib_with_rust-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

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

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page