MNN/source/backend/cpu/compute/ConvolutionIntFactory.hpp

37 lines
1.1 KiB
C++
Raw Normal View History

2019-04-17 10:49:11 +08:00
//
// ConvolutionIntFactory.hpp
// MNN
//
// Created by MNN on 2018/08/06.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef ConvolutionIntFactory_hpp
#define ConvolutionIntFactory_hpp
#include <stdint.h>
#include <memory>
2019-12-27 22:16:57 +08:00
#include "backend/cpu/CPUBackend.hpp"
#include "core/AutoStorage.h"
2019-04-17 10:49:11 +08:00
#include "MNN_generated.h"
namespace MNN {
class ConvolutionIntFactory {
public:
struct Int8Common {
AutoStorage<int8_t> weight;
AutoStorage<float> alpha;
AutoStorage<float> weightFloat;
const IDSTQuan* quan;
};
MNN_PUBLIC static std::shared_ptr<Int8Common> load(const IDSTQuan* quan, bool forceFloat = false);
static Execution* create(const Tensor* input, const Tensor* output, const MNN::Op* op, Backend* backend,
const Int8Common* common);
static Execution* createUnit(const Tensor* input, const Tensor* output, const MNN::Op* op, Backend* bn,
const Int8Common* common, const float* bias, size_t biasSize);
};
} // namespace MNN
#endif /* ConvolutionIntFactory_hpp */