forked from alibaba/MNN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLRN.cpp
More file actions
34 lines (29 loc) · 963 Bytes
/
Copy pathLRN.cpp
File metadata and controls
34 lines (29 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// LRN.cpp
// MNNConverter
//
// Created by MNN on 2019/01/31.
// Copyright © 2018, Alibaba Group Holding Limited
//
#include "OpConverter.hpp"
class Lrn : public OpConverter {
public:
void run(MNN::OpT* dstOp, const caffe::LayerParameter& parameters, const caffe::LayerParameter& weight);
virtual MNN::OpType opType() {
return MNN::OpType_LRN;
}
virtual MNN::OpParameter type() {
return MNN::OpParameter_LRN;
}
};
void Lrn::run(MNN::OpT* dstOp, const caffe::LayerParameter& parameters, const caffe::LayerParameter& weight) {
MNN::LRNT* lrn = new MNN::LRNT;
dstOp->main.value = lrn;
auto caffeLrn = parameters.lrn_param();
lrn->alpha = caffeLrn.alpha();
lrn->beta = caffeLrn.beta();
lrn->localSize = caffeLrn.local_size();
lrn->regionType = caffeLrn.norm_region();
}
static OpConverterRegister<Lrn> a("LRN");
static OpConverterRegister<Lrn> _a("CuDNNLRNCrossChannel");