Hi,
In Python I can get the PyTorch version string with:
print(torch.__version__)
However, I did not figure out a way to do the same with the C++ libtorch interface?
Does someone know how to retrieve the libtorch version string using the C++ interface?
Thanks!
Thomas
2 Likes
Willem
(Willemv J)
June 17, 2020, 8:23am
2
Was wondering about the same. Did you find out whether this is possible yet?
bigcmos
(Daniel Aden)
September 9, 2020, 6:08am
3
Did you figure out a way to do it? I filed a feature request for this issue:
opened 06:08AM - 09 Sep 20 UTC
🚀 Feature
I want to be able to determine the version of libtorch in my c++ binary in cases where I don't...
1 Like
Shisho_Sama
(A curious guy here!)
May 9, 2021, 1:53am
4
Starting from 1.8, one can use TORCH_VERSION_{MAJOR,MINOR,PATCH}
for this.
#include <torch/torch.h>
#include <iostream>
int main() {
std::cout << "PyTorch version: "
<< TORCH_VERSION_MAJOR << "."
<< TORCH_VERSION_MINOR << "."
<< TORCH_VERSION_PATCH << std::endl;
}
Prints:
PyTorch version: 1.8.0
2 Likes
Is it possible to also report the CUDA version the library was compiled for?