[mlir][tosa] Add broadcasting case for tosa.resize degenerate case
authorRob Suderman <suderman@google.com>
Thu, 20 Oct 2022 21:16:10 +0000 (14:16 -0700)
committerRob Suderman <suderman@google.com>
Thu, 20 Oct 2022 22:37:19 +0000 (15:37 -0700)
commit4309bb28ae77061d528b09dfe1c41335e92bc7a3
tree3ab3d6d27fe380d9ff196facd82d4863748b343a
parent8c7a1f87617067bc23c2e0733fe5e3202e1d6e81
[mlir][tosa] Add broadcasting case for tosa.resize degenerate case

When the resize is ?x1x1x?, the tosa.resize operation broadcasts the
input and (when quantized) applies a scaling factor. Updated the resize
operation to not use a tensor.extract operation, instead broadcasting
the only positional value as necessary.

Moved the tosa.resize tests to their own mlir test due to increased
complexity. Also corrected a bug where tosa.resize for bilinear-floating
point was not applying the correct scaling.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D136299
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-resize.mlir [new file with mode: 0644]
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir