#cpp #rust #libtorch

ai_copper

Binding Rust para C++ usando a libtorch

2 releases

new 0.1.2 Apr 13, 2025
0.1.0 Apr 13, 2025

#77 in #cpp

Download history 167/week @ 2025-04-08

167 downloads per month

MIT license

430KB
6.5K SLoC

D 5K SLoC C++ 678 SLoC // 0.1% comments C 661 SLoC // 0.1% comments Rust 84 SLoC TypeScript 2 SLoC

Contains (ELF exe/lib, 17KB) a.out, (ELF exe/lib, 17KB) CMakeDetermineCompilerABI_C.bin, (ELF exe/lib, 17KB) CMakeDetermineCompilerABI_CXX.bin, (ELF exe/lib, 17KB) a.out

ai_copper

ai_copper is a Rust library that provides bindings to the C++ libtorch library from PyTorch, allowing the use of tensors and machine learning operations directly in Rust. This library is designed to facilitate the integration between Rust and C++ for projects that utilize libtorch for machine learning implementations.

Features

  • Create tensors directly in Rust using libtorch.
  • Support for basic tensor manipulation operations.
  • Easy integration with PyTorch for running machine learning models in Rust.

Requirements

  • Rust: The library is designed to work with the latest version of Rust.
  • C++: A C++ compiler must be installed on your system.
  • libtorch: The PyTorch C++ library (CPU version) must be installed on your system.

Installation

To add ai_copper to your Rust project:

cargo add ai_copper

Include the following line in your Cargo.toml:

[dependencies]
ai_copper = "0.1"

Dependencies

~8.5MB
~143K SLoC