[ONNX] Fix for sequence of mutations in blocks (#51577) (#52347)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/52347
Fixes consecutive mutations in a tensor inside blocks.
Also, support append and pop in blocks.
Test Plan: Imported from OSS
Reviewed By: malfet
Differential Revision: D26490328
Pulled By: SplitInfinity
fbshipit-source-id: f0cdc706d2793e1f4eb0503d3e0f63f4127ea47a