Saving PyTorch tensors from c++ application

Hi, I’m looking for a good way for saving a tensor from a c++ application.

Since my application basically generates the dataset to be read from PyTorch, it would be useful to directly save the data I need as tensors.

Right now i’m using THFloatTensor (including TH/TH.h from torch), but since I’m not using torch anymore I’d like to use a native PyTorch method.

Does anyone have any suggestions?