//===- TosaDecomposeConv2D.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 Conv2D operation to a series of TOSA Ops specifically // (1) Convert a 1x1 Convolution to a Reshape->FC->Reshape // //===----------------------------------------------------------------------===// #include "mlir/Dialect/Tosa/IR/TosaOps.h" #include "mlir/Dialect/Tosa/Transforms/Passes.h" #include "mlir/Dialect/Tosa/Utils/ConversionUtils.h" usingnamespacemlir; usingnamespacemlir::tosa; namespace { SmallVector<int64_t> convertFromMlirShape(ArrayRef<int64_t> shape) { … } struct Conv2DIsFullyConnected : public OpRewritePattern<tosa::Conv2DOp> { … }; } // namespace void mlir::tosa::populateTosaDecomposeConv2D(MLIRContext *ctx, RewritePatternSet &patterns) { … }