34 lines
825 B
C++
34 lines
825 B
C++
//
|
|
// OnnxSoftplus.cpp
|
|
// MNNConverter
|
|
//
|
|
// Created by MNN on 2019/12/05.
|
|
// Copyright © 2018, Alibaba Group Holding Limited
|
|
//
|
|
|
|
#include <MNN/expr/ExprCreator.hpp>
|
|
#include "MNN_generated.h"
|
|
#include "OnnxExtraManager.hpp"
|
|
|
|
namespace MNN {
|
|
namespace Express {
|
|
|
|
class OnnxSoftplusTransform : public OnnxExtraManager::Transform {
|
|
public:
|
|
virtual EXPRP onExecute(EXPRP expr) const override {
|
|
auto input = expr->inputs()[0];
|
|
auto newExpr = _Softplus(input)->expr().first;
|
|
newExpr->setName(expr->name());
|
|
return newExpr;
|
|
}
|
|
};
|
|
|
|
static auto gRegister = []() {
|
|
OnnxExtraManager::get()->insert("Softplus",
|
|
std::shared_ptr<OnnxExtraManager::Transform>(new OnnxSoftplusTransform));
|
|
return true;
|
|
}();
|
|
|
|
} // namespace Express
|
|
} // namespace MNN
|