2019-04-17 10:49:11 +08:00
|
|
|
//
|
|
|
|
// Convolution1x1Strassen.hpp
|
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2019/02/12.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Convolution1x1Strassen_hpp
|
|
|
|
#define Convolution1x1Strassen_hpp
|
|
|
|
|
|
|
|
#include <functional>
|
2019-12-27 22:16:57 +08:00
|
|
|
#include "backend/cpu/CPUConvolution.hpp"
|
|
|
|
#include "backend/cpu/compute/StrassenMatmulComputor.hpp"
|
2019-04-17 10:49:11 +08:00
|
|
|
namespace MNN {
|
|
|
|
class Convolution1x1Strassen : public CPUConvolution {
|
|
|
|
public:
|
|
|
|
Convolution1x1Strassen(const Convolution2DCommon *common, Backend *b, const float *originWeight,
|
|
|
|
size_t originWeightSize, const float *bias, size_t biasSize);
|
|
|
|
virtual ~Convolution1x1Strassen();
|
|
|
|
|
|
|
|
virtual ErrorCode onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
|
|
|
|
|
|
|
|
virtual ErrorCode onResize(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) override;
|
|
|
|
|
|
|
|
virtual ErrorCode onReleaseCache() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::shared_ptr<Tensor> mWeight;
|
|
|
|
std::shared_ptr<Tensor> mBias;
|
2020-05-17 23:09:45 +08:00
|
|
|
void _init(const Convolution2DCommon *common, Backend *b, const float *originWeight,
|
|
|
|
size_t originWeightSize, const float *bias, size_t biasSize);
|
2019-04-17 10:49:11 +08:00
|
|
|
|
|
|
|
CPUConvolution::POSTFUNCTION mPostFunction;
|
2020-05-17 23:09:45 +08:00
|
|
|
std::shared_ptr<Tensor> mTempInputPack;
|
|
|
|
std::shared_ptr<Tensor> mTempOutputPack;
|
2020-05-19 13:40:35 +08:00
|
|
|
std::vector<size_t> mParameters;
|
2019-04-17 10:49:11 +08:00
|
|
|
};
|
|
|
|
} // namespace MNN
|
|
|
|
|
|
|
|
#endif /* Convolution1x1Strassen_hpp */
|