Solved by Maverobot in post #3 
              
              
                I have got a working code snippet in case anyone else faces the same issue. 
#include <torch/torch.h>

template <typename T>
void pretty_print(const std::string& info, T&& data) {
  std::cout << info << std::endl;
  std::cout << data << std::endl << std::endl;
}

int main(int /*argc*/, char* /*argv*…