Skip to content

pierric/aotinductor-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Latest Documentation

aotinductor-rs

Rust bindings for pytorch AOTInductor.

Build

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.

  • If you are using pytorch, then the path is in the site-packages folder: .../lib/python3.xx/site-packages/torch/
  • If you have downloaded a libtorch, then the path is where you unpackaged the library.

Getting Started

use aotinductor::ModelPackage;
use tch::Tensor;

let model = ModelPackage::new("path/to/some.pt2").expect("model should be loaded");
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> = model.run(&vec![inp1, inp2]);

About

rust bindings for pytorch AOTInductor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published