"git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "cb83ac0f3371210010a929f2c8946d31b9b00183"
Fix Nonzero to track data value with sentinel value based on elements
We can't change the behaviour of the nonzero op and we currently pad the output
with zeros. This unfortunately obfuscates the following cases:
1. When the only nonzero element is the first index - the whole tensor is padded
with zeros its not obvious if the first value is valid index or padded
2. When the nonzero elements vector is used for indicies. The resulting vector
with the padded value of 0 is still a valid index thus gather/gatherND and other ops
will assume the 0 index is valid and operate accordingly.
In this case, by adding a sentinel value of the number of static elements used
by the desired shape, the resulting nonzero output can now track how many elements
are valid by determining the value in the correct range.
Originally I intended to use -1 but not all datatypes use this if say, we're dealing with
unsigned values in our vectors or booleans.
Signed-off-by:
Ted Themistokleous <ted.themistokleous@amd.com>
Showing
Please register or sign in to comment