Optimize CPU version performance of the nonzero function. (#15925)
Summary:
Same as #15190 but compatible with MSVS compiler
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15925
Differential Revision: D13623473
Pulled By: VitalyFedyunin
fbshipit-source-id: d0db9dbc1a0d8fc9bda08348cb1d3763ae9f8679