[Static runtime] refactor MemoryPlanner codes to prepare for output tensor memory planning (#55809)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55809
[Static runtime] refactor MemoryPlanner codes to prepare for output tensor memory planning
Test Plan: buck test mode/dev //caffe2/caffe2/fb/predictor:pytorch_predictor_test -- --exact 'caffe2/caffe2/fb/predictor:pytorch_predictor_test - PyTorchPredictor.StaticRuntime'
Reviewed By: bwasti
Differential Revision: D27411416
fbshipit-source-id: 7dae7c2586ce3b4ebacf6169017140166c30e99c