Removes nonzero method warning (#51618)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/44284
https://github.com/pytorch/pytorch/pull/45413 incorrectly left this only partially fixed because it did not update the separate list of method signatures that were deprecated. This PR correctly fixes https://github.com/pytorch/pytorch/issues/44284. A test is added for the behavior, but until the WARN_ONCE flag is added it's toothless.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51618
Reviewed By: ngimel
Differential Revision: D26220181
Pulled By: mruberry
fbshipit-source-id: 397b47ac7e962d108d8fde0f3dc6468d6327d1c3