[torch.package/TorchScript] logic to enable sharing of tensors on load (#57573)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/57573
Test Plan: Imported from OSS
Reviewed By: suo
Differential Revision: D28226975
Pulled By: Lilyjjo
fbshipit-source-id: bc8cb3e8052fa18336c437e0601d8b0028fd1895