2019-07-11 13:56:52 +08:00
|
|
|
//
|
|
|
|
// CPUDepthwiseConvInt8.hpp
|
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2019/5/17.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CPUDepthwiseConvInt8_hpp
|
|
|
|
#define CPUDepthwiseConvInt8_hpp
|
|
|
|
|
2021-01-06 16:29:37 +08:00
|
|
|
#include "CPUConvInt8.hpp"
|
2019-07-11 13:56:52 +08:00
|
|
|
namespace MNN {
|
|
|
|
|
2021-01-06 16:29:37 +08:00
|
|
|
class CPUDepthwiseConvInt8 : public Execution {
|
2019-07-11 13:56:52 +08:00
|
|
|
public:
|
2021-04-08 15:34:23 +08:00
|
|
|
CPUDepthwiseConvInt8(Backend *backend, const MNN::Convolution2D *convOp, float inputScale, float outputScale);
|
2021-01-06 16:29:37 +08:00
|
|
|
virtual ~CPUDepthwiseConvInt8();
|
2019-07-11 13:56:52 +08:00
|
|
|
virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
|
|
|
|
virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
|
2021-01-06 16:29:37 +08:00
|
|
|
virtual bool onClone(Backend* bn, const Op* op, Execution** dst) override;
|
2019-07-11 13:56:52 +08:00
|
|
|
private:
|
2021-01-06 16:29:37 +08:00
|
|
|
CPUDepthwiseConvInt8(std::shared_ptr<CPUConvInt8::ResourceInt8> resource, const MNN::Convolution2DCommon* common, Backend* backend) : Execution(backend) {
|
|
|
|
mCommon = common;
|
|
|
|
mResource = resource;
|
|
|
|
}
|
2019-07-11 13:56:52 +08:00
|
|
|
int mThreadNumber;
|
2021-01-06 16:29:37 +08:00
|
|
|
std::shared_ptr<CPUConvInt8::ResourceInt8> mResource;
|
|
|
|
Tensor mInputPad;
|
|
|
|
const Convolution2DCommon* mCommon;
|
|
|
|
std::pair<int, int> mPads;
|
|
|
|
std::pair<int, int> mPaddedSize;
|
|
|
|
std::pair<int, int> mStrides;
|
|
|
|
std::pair<int, int> mDilates;
|
|
|
|
std::pair<int, int> mKernels;
|
2019-07-11 13:56:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace MNN
|
|
|
|
|
|
|
|
#endif /* CPUDepthwiseConvInt8_hpp */
|