[JIT] Specialize autograd zero: fix the guarding condition. (#43846)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/43846
We are looking for tensors that are expected to be undefined (according
to the profile info) and should be checking for them to satisfy the
following condition: "not(have any non-zero)", which is equivalent to
"tensor is all zeros". The issue was that we've been checking tensors
that were expected *not* to be undefined.
Test Plan: Imported from OSS
Reviewed By: eellison
Differential Revision: D23416198
Pulled By: ZolotukhinM
fbshipit-source-id: 71e22f552680f68f2af29f427b7355df9b1a4278
Author
Mikhail Zolotukhin