//===- TosaDecomposeTransposeConv.cpp -------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Decompose TOSA TransposeConv operation to a series of TOSA Ops specifically // (1) Convert a Dilated TransposeConv2D to Conv2D including reversing/reshaping // etc.. of the weights (2) Convert a Strided TransposeConv2D to Conv2D // including transposing/reversing/reshaping etc.. // of the weights and input/output tenors and reversing/reshaping etc .. of // the weights // //===----------------------------------------------------------------------===// #include "mlir/Dialect/Tosa/IR/TosaOps.h" #include "mlir/Dialect/Tosa/Transforms/Passes.h" #include "mlir/Dialect/Tosa/Utils/ConversionUtils.h" #include "mlir/Dialect/Tosa/Utils/ShapeUtils.h" #include "mlir/Pass/Pass.h" usingnamespacemlir; usingnamespacemlir::tosa; namespace { class TransposeConvNonStridedConverter : public OpRewritePattern<tosa::TransposeConv2DOp> { … }; class TransposeConvStridedConverter : public OpRewritePattern<tosa::TransposeConv2DOp> { … }; } // namespace void mlir::tosa::populateTosaDecomposeTransposeConv( MLIRContext *ctx, RewritePatternSet &patterns) { … }