add add_node function for partition to fix partition mem size calculation (#47083)
Summary:
Placeholders and constants in the partition are counted twice when combining two partitions. This PR fixes it by adding add_node function into Partition class. A unit test is also updated to test if the partition size is correct
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47083
Reviewed By: gcatron
Differential Revision: D24634368
Pulled By: scottxu0730
fbshipit-source-id: ab408f29da4fbf729fd9741dcb3bdb3076dc30c4