Skip to content

interesaaat/LibTorchSharp

Repository files navigation

libTorchSharp

System Status
Linux Build Status
MaxOS Build Status
Windows Build Status

Building instruction

Requirements

  • cmake
  • libtorch download here(to get version 1.0.1 just change -latest with -1.0.1)

How to generate project files

  • Windows: cmake -DTorch_DIR="YOUR_libtorch_DIR\share\cmake\Torch" . -G "Visual Studio 15 2017 Win64"
  • Linux: cmake -DTorch_DIR="YOUR_libtorch_DIR/share/cmake/Torch" .
  • For CUDA support add -DCMAKE_BUILD_TYPE="Release" to the commands above.

How to build in Windows

  • Open the generated solution file, click on Properties on the LibTorch project and select Dynamic Library instead of Static in the Configuration type tab (remeber to also change the target extension).
  • Build the solution
  • (In case VS complains about some Python lib not in the path, go into Properties, Linked, Include, and manually include those libs)

How to build in Linux

  • Just type make. The libTorchSharp.so file will be generated in the project location.

Tested on

  • Windows 10 machine (with Linux subsystem)
  • Ubuntu 18.04
  • libtorch 1.0 and 1.0.1
  • Visual Studio 2017 (v141, Windows SDK 10.0.17134.0)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published