added a serialize function in SGD class to utilize the existing macro for serialization/deserialization calls
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/30739
Differential Revision: D18842908
Pulled By: anjali411
fbshipit-source-id: 7dc13ff9c4fc126790b88b1b4b5d03425c349d38