Libtorch interacting with pytorch

I am having trouble understanding how libtorch interacts with pytorch.

As I understand the backend of pytorch is written to a large degree in C++ anyway and then Peter built upon that and provided a C++ interface.

But how does libtorch (a collection of precompiled binaries and headers) relate to ordinary pytorch.
Is it just the pytorch backend bundled up together with the novel C++ frontend? Or is there somethign more to it?

And how and when do new changes. e.g the most recent commit of Peter to the master branch releft (if ever) on libtorch?

and if I decide to build pytorch from source via the files hosted on github, is libtorch included then already?

or is libtorch a standalone pytorch framework?

I am confused =/

bump,still didnt get it

I am having trouble too. I could not solve how to use pytorch model in C++. Any blog or clear tutorial?

But how does libtorch (a collection of precompiled binaries and headers) relate to ordinary pytorch.
Is it just the pytorch backend bundled up together with the novel C++ frontend? Or is there somethign more to it?

There’s nothing more to it.

To explain with further detail, all of the PyTorch backend (ATen, Caffe2, the CPU and GPU bits) is packaged up into libcaffe2.so and libcaffe2_gpu.so and a few other minor bits. libtorch.so links to these and also includes the C++ API bits.

1 Like

all right, thank you.

So libtorch is the fully-fletched pytorch, i.e. has the same capabilities than the ordinary pytorch with python frontend or are there some limitations?

the libtorch C++ API might not cover the PyTorch API surface completely. See https://pytorch.org/cppdocs/ for what’s covered.
I’d expect holes / missing coverage to be in the torch.nn / torch.optim namespaces, where some layers / optimizers are not yet hooked up to the C++ frontend.

and is there some time frame where one could expect the C++ API to comprise the missing pieces and be in sync with the python development?

where is libcaffe2_gpu.so located?

I cant find it in either the CPU version nor the cuda 9 version of libtorch…