This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tosa] Fix dinamic shape inference in conv2d
ClosedPublic

Authored by Anastasia on Sep 2 2022, 7:53 AM.

Details

Summary

The comment in the code correctly states the equation for the shape inference as follows:

H = ((IH+pad_top+pad_bottom-(dilation_y*(KH-1)+1))/stride_y)+1

However the final operation is generated as - instead of +. I believe + is indeed correct. For example if we have an image with dimension 6 and kernel of dimension 3 (assuming padding is 0 and stride and dilation are both 1) we are expecting 4 elements in the output (computed for image elements (0, 1, 2) x kernel, (1, 2, 3) x kernel, (2, 3, 4) x kernel and (3, 4, 5) x kernel. However currently only 2 elements are produced in the output.

Diff Detail

Event Timeline

Anastasia created this revision.Sep 2 2022, 7:53 AM
Anastasia requested review of this revision.Sep 2 2022, 7:53 AM
Anastasia edited the summary of this revision. (Show Details)Sep 2 2022, 7:56 AM
NatashaKnk accepted this revision.Sep 2 2022, 9:44 AM

Good catch, thanks!

This revision is now accepted and ready to land.Sep 2 2022, 9:44 AM
This revision was landed with ongoing or failed builds.Sep 6 2022, 3:43 PM
This revision was automatically updated to reflect the committed changes.