I could save the file using but I have difficulty loading from it :
for saving I simply did :
template <typename... SaveToArgs>
void save(const std::vector<std::tuple<std::string, torch::Tensor>>& tensor_vec, SaveToArgs&&... args) 
{
    torch::serialize::OutputArchive archive(std::make_shared<torch::jit::CompilationUnit>());
    for (size_t i = 0; i < tensor_vec.size(); i+=2) 
    {
        auto& key_value = tensor_vec[i];
        auto key_name= std::get<0>(key_value);
        auto value_tensor = std::get<1>(key_value);

        archive.write(c10::to_string(i), key_name);
        archive.write(c10::to_string(i+1), value_tensor);
    }
    archive.save_to(std::forward<SaveToArgs>(args)...);

}

and similarly for load:
template <typename... LoadFromArgs>
void load(std::vector<std::tuple<std::string, torch::Tensor>>& tensor_vec, LoadFromArgs&&... args)
{
    torch::serialize::InputArchive archive;
    archive.load_from(std::forward<LoadFromArgs>(args)...);

    // NOTE: The number of elements in the serialized `std::vector<torch::Tensor>`
    // is not known ahead of time, so we need a while-loop to increment the index,
    // and use `archive.try_read(...)` to check whether we have reached the end of
    // the serialized `std::vector<torch::Tensor>`.
    size_t index = 0;
    torch::Tensor value;
    std::string key_value;
    while (archive.try_read(c10::to_string(index), key_value))
    {
        archive.try_read(c10::to_string(index+1), value);
        tensor_vec.push_back(std::make_tuple(key_value, std::move(value)));
        value = torch::Tensor();
        key_value = "";
        index+=2;
    }
}

the prblem that I’m facing here is that the InputArchive currently doesnt have support for reading std::string and the InputArchive is final and I can not extend it.
any help in this regard is greatly appreciated.
@ptrblck @albanD