Replace all ASSERTM in serialization (#51756)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/51756
Test Plan: Imported from OSS
Reviewed By: Lilyjjo
Differential Revision: D26280320
Pulled By: bdhirsh
fbshipit-source-id: ddba1fe46b9f39234f010aac9cdf198e82727f84