Make a copy of the submodule inputs (#87899)
Summary: There might be inplace ops in the model that would change the saved inputs. To avoid that, we save a deepcopy version.
Test Plan: CI
Differential Revision: D40771290
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87899
Approved by: https://github.com/houseroad