Commit 6a8178a9 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Offset element number

This fixes asserts but its a kludge. Correct solution needs to be a matcher
for when we see onzero -> transpose -> gathernd/gather as we're using
shape as a index here but shape is 1 based not zero based
parent c1051d51
...@@ -44,7 +44,7 @@ struct nonzero ...@@ -44,7 +44,7 @@ struct nonzero
shape compute_shape(std::vector<shape> inputs) const shape compute_shape(std::vector<shape> inputs) const
{ {
check_shapes{inputs, *this}.has(1).standard(); check_shapes{inputs, *this}.has(1).standard();
auto elem_num = inputs[0].elements(); auto elem_num = inputs[0].elements() - 1;
auto dim_num = inputs[0].lens().size(); auto dim_num = inputs[0].lens().size();
std::vector<std::size_t> out_lens = {dim_num, elem_num}; std::vector<std::size_t> out_lens = {dim_num, elem_num};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment