2019-04-17 10:49:11 +08:00
|
|
|
//
|
|
|
|
// CPUPool.cpp
|
|
|
|
// MNN
|
|
|
|
//
|
|
|
|
// Created by MNN on 2018/07/15.
|
|
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
|
|
//
|
|
|
|
|
2019-12-27 22:16:57 +08:00
|
|
|
#include "backend/cpu/CPUPool.hpp"
|
2020-11-05 16:41:56 +08:00
|
|
|
#include "math/Vec.hpp"
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
|
2020-11-05 16:41:56 +08:00
|
|
|
using Vec4 = MNN::Math::Vec<float, 4>;
|
2021-04-08 15:34:23 +08:00
|
|
|
using Vec16 = MNN::Math::Vec<int8_t, 16>;
|
2019-04-17 10:49:11 +08:00
|
|
|
|
|
|
|
namespace MNN {
|
|
|
|
|
|
|
|
|
|
|
|
class CPUPoolCreator : public CPUBackend::Creator {
|
|
|
|
public:
|
|
|
|
virtual Execution *onCreate(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs,
|
|
|
|
const MNN::Op *op, Backend *backend) const override {
|
2021-04-08 15:34:23 +08:00
|
|
|
if (inputs[0]->getType() == halide_type_of<int8_t>()) {
|
|
|
|
return new CPUPool<int8_t, Vec16>(backend, op->main_as_Pool());
|
|
|
|
}
|
|
|
|
return new CPUPool<float, Vec4>(backend, op->main_as_Pool());
|
2019-04-17 10:49:11 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
REGISTER_CPU_OP_CREATOR(CPUPoolCreator, OpType_Pooling);
|
2019-12-27 22:16:57 +08:00
|
|
|
|
2019-04-17 10:49:11 +08:00
|
|
|
} // namespace MNN
|