Linear autodiff revert revert (#51613)
Summary:
patch PR https://github.com/pytorch/pytorch/issues/50856 and rollbak the revert D26105797 (https://github.com/pytorch/pytorch/commit/e488e3c4436b10caeed246573bdf030c65f434af)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51613
Reviewed By: mruberry
Differential Revision: D26253999
Pulled By: ngimel
fbshipit-source-id: a20b1591de06dd277e4cd95542e3291a2f5a252c