MNN/source/backend/cpu/CPUInterp.hpp

39 lines
1003 B
C++
Raw Normal View History

2019-04-17 10:49:11 +08:00
//
// CPUInterp.hpp
// MNN
//
// Created by MNN on 2018/07/17.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef CPUInterp_hpp
#define CPUInterp_hpp
2019-12-27 22:16:57 +08:00
#include "backend/cpu/CPUResize.hpp"
2019-04-17 10:49:11 +08:00
namespace MNN {
class CPUInterp : public CPUResizeCommon {
2019-04-17 10:49:11 +08:00
public:
CPUInterp(Backend *backend, float widthScale, float heightScale, int resizeType, bool AlignCorners, bool halfPixelCenters);
virtual ~CPUInterp();
2019-04-17 10:49:11 +08:00
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;
2019-04-17 10:49:11 +08:00
private:
Tensor mWidthPosition;
Tensor mWidthFactor;
Tensor mHeightPosition;
Tensor mHeightFactor;
Tensor mLineBuffer;
2019-04-17 10:49:11 +08:00
float mWidthScale;
float mHeightScale;
int mResizeType; // 1:near 2: bilinear 3: cubic
bool mAlignCorners;
bool mHalfPixelCenters;
2019-04-17 10:49:11 +08:00
};
} // namespace MNN
#endif /* CPUInterp_hpp */