Move view handling logic to gen_inplace_or_view_type.py (#53341)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/53341
Test Plan: Imported from OSS
Reviewed By: nikithamalgifb
Differential Revision: D26973912
Pulled By: ailzhang
fbshipit-source-id: ea31bdef0beac6996d509f5d45ebefa3ea8e2b89