| Crates.io | aotinductor |
| lib.rs | aotinductor |
| version | 0.1.2 |
| created_at | 2025-02-05 12:13:13.820206+00 |
| updated_at | 2025-02-05 13:35:37.394858+00 |
| description | Rust wrappers for the PyTorch AOTInductor api. |
| homepage | |
| repository | https://github.com/pierric/aotinductor-rs |
| max_upload_size | |
| id | 1543883 |
| size | 745,665 |
Rust bindings for pytorch AOTInductor.
This crate requires the libtorch in the same version as tch-rs. You need to set the environment variable LIBTORCH to the path to folder of the library.
.../lib/python3.xx/site-packages/torch/use aotinductor::ModelPackage;
use tch::Tensor;
if let Some(model) = ModelPackage::new("path/to/some.pt2") {
let inp1 = Tensor::rand([1, 2], (tch::Kind::Float, tch::Device::Cpu));
let inp2 = Tensor::rand([1, 4], (tch::Kind::Float, tch::Device::Cpu));
let out: std::vec::Vec<Tensor> = loader.run(&vec![inp1, inp2]);
};