How to copy parameters of one network to another directly in Libtorch C++?

saving and loading is ok, but not elegant

std::shared_ptr<MLP> NetA;
std::shared_ptr<MLP> NetB;

// ...

torch::save(NetA, "./model.pt");
torch::load(NetB, "./model.pt");

REF: (libtorch) How to save model in MNIST cpp example?