Add basic Module serialization BC test (#96238)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/96238
Approved by: https://github.com/ezyang
This commit is contained in:
albanD
2023-03-07 18:35:27 -05:00
committed by PyTorch MergeBot
parent 5bbec680d7
commit c8216e558b
2 changed files with 13 additions and 1 deletions

View File

@ -2,5 +2,9 @@ import sys
import torch
if __name__ == '__main__':
print(torch.jit.load(sys.argv[1]))
script_mod = torch.jit.load(sys.argv[1])
mod = torch.load(sys.argv[1] + ".orig")
print(script_mod)
inp = torch.rand(2, 28 * 28)
_ = mod(inp)
sys.exit(0)