det_backward: correct, more robust and with complex support [clone] (#61905)
Summary:
Clone of https://github.com/pytorch/pytorch/pull/58195 to ease the import. Done by request from anjali411
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61905
Reviewed By: albanD
Differential Revision: D29937920
Pulled By: anjali411
fbshipit-source-id: 025892a8e6147790825b20458986730ad8c5bb0f