Fix scalar^tensor derivative for scalars that are zero
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/32063
Test Plan: Imported from OSS
Differential Revision: D19394258
Pulled By: agolynski
fbshipit-source-id: 3eed0f9cc1b8c677c6948c927d007044be67fe7f