// // CPUUnary.hpp // MNN // // Created by MNN on 2018/08/02. // Copyright © 2018, Alibaba Group Holding Limited // #ifndef CPUUnary_hpp #define CPUUnary_hpp #include "core/Execution.hpp" #include "compute/CommonOptFunction.h" namespace MNN { class CPUUnary : public Execution { public: CPUUnary(Backend *b, MNNUnaryExecute proc, MNNUnaryExecuteInt8 procInt8, const Op* op); virtual ~CPUUnary() = default; virtual ErrorCode onResize(const std::vector &inputs, const std::vector &outputs) override; virtual ErrorCode onExecute(const std::vector &inputs, const std::vector &outputs) override; static MNNUnaryExecute selectForFloat(int type, int precision); static MNNUnaryExecuteInt8 selectForInt8(int type); protected: MNNUnaryExecute mProc; MNNUnaryExecuteInt8 mProcInt8; std::vector mInpScale; std::vector mOupScale; std::vector mInpZeroPoint; std::vector mOupZeroPoint; std::vector mMaxMinValue; std::vector mTableBuffer; }; } // namespace MNN #endif /* CPUUnary_hpp */