Skip to content

Conversation

@WilBrady
Copy link
Contributor

@WilBrady WilBrady commented Jul 11, 2022

Description: Nonzero is not a typical unary op as the output shape is not the same as the input self tensor.

Motivation and Context
The current nonzero implementation in eager mode is not correctly aligned with aten behavior. First Onnx produces an output that is transposed to that of aten and pytorch. Second the output is a list of indexes and not the same shape as the input tensor. For those reasons, we need to directly implement both nonzero and nonzero.out.

@WilBrady WilBrady force-pushed the wilbrady/fixNonzero branch 2 times, most recently from 4e94c33 to e81d936 Compare July 12, 2022 11:05
@WilBrady WilBrady marked this pull request as ready for review July 12, 2022 12:52
@WilBrady WilBrady requested review from msftlincoln and souptc July 12, 2022 12:52
@WilBrady WilBrady force-pushed the wilbrady/fixNonzero branch from e81d936 to ee150d7 Compare July 12, 2022 16:03
msftlincoln
msftlincoln previously approved these changes Jul 12, 2022
msftlincoln
msftlincoln previously approved these changes Jul 12, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jul 12, 2022

This pull request introduces 4 alerts when merging d99e80f into a6fd1a3 - view on LGTM.com

new alerts:

  • 4 for Unused import

@WilBrady WilBrady merged commit 48647bc into microsoft:master Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants