Read c++ libtorch tensor into python

I am able to write a tensor to a file in c++

somefunc(at::Tensor& image) {
torch::save(image, "original_image.pt");

and then when I load into python and look at it’s contents it see

cpp_tensor=torch.load("original_image.pt")
cpp_tensor

I get

RecursiveScriptModule(original_name=Module)

Am I able to access the tensor from the “RecursiveScriptModule”? When I do the same thing with pytorch it just returns the original tensor. How do access the original tensor?

This should work to save a tensor in libtorch and load it in Python:

#include <torch/torch.h>
#include <iostream>

int main() {
  auto tensor = torch::ones({3, 3});
  auto bytes = torch::pickle_save(tensor);
  std::ofstream fout("lala.pt", std::ios::out | std::ios::binary);
  fout.write(bytes.data(), bytes.size());
  fout.close();
}
>>> import torch
>>> x = torch.load('lala.pt')
>>> x
tensor([[1., 1., 1.],
        [1., 1., 1.],
        [1., 1., 1.]])