libtorch

An open source machine learning framework that accelerates the path from research prototyping to production deployment.

Latest version: 2.5.0

Add to xmake.lua

add_requires("libtorch 2.5.0")

Learn how to add and link packages with Xmake →

Information

License
BSD-3-Clause
Recipe updated
2025-01-14T02:08:06.000Z

Platforms

  • linux: i386, x86_64, armv7, armv7s, arm64, mips, mips64, mipsel, mips64el, loong64, riscv64, s390x, ppc, ppc64, ppc64el, sparc64
  • macosx: x86_64, arm64
  • windows: x64

Options

blas
Set BLAS vendor. · Type: string · Default: openblas · Values: mkl, openblas, eigen
cuda
Enable CUDA support. · Type: boolean · Default: false
distributed
Enable distributed support. · Type: boolean · Default: false
ninja
Use ninja as build tool. · Type: boolean
openmp
Use OpenMP for parallel code. · Type: boolean · Default: true
protobuf-cpp
Use protobuf from xrepo. · Type: boolean · Default: false
pybind11
Use pybind11 from xrepo. · Type: boolean · Default: false
python
Build python interface. · Type: boolean · Default: false
shared
Build shared library. · Type: boolean · Default: true

Versions

  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.9.0
  • v1.9.1
  • v1.11.0
  • v1.12.1
  • v2.1.0
  • v2.1.2
  • v2.2.2
  • v2.3.1
  • v2.4.0
  • v2.5.0

Dependencies

Install with xrepo

Install the package independently of a project and inspect its available configuration.

install

xrepo install "libtorch 2.5.0"

show info

xrepo info "libtorch"

Link a library to your target

Declare the requirement, then attach the library to the target that uses it.

xmake.lua

add_requires("libtorch 2.5.0")

target("demo")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("libtorch")

Open a package environment

Open a shell with the environment exported by this package. Use the executable names documented by the package.

enter shell

xrepo env -b "libtorch 2.5.0" shell