Move upgraders from python to cpp (#70593)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/70593
Test Plan: Imported from OSS
Reviewed By: gmagogsfm
Differential Revision: D33402543
Pulled By: tugsbayasgalan
fbshipit-source-id: 713c54fbbb2bc4c96d5e3b6084f3090a8923a12d
(cherry picked from commit e72b375264395ac1264c07e9c69dd0dd7adfebb8)