forked from alibaba/MNN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShuffleChannel.cpp
More file actions
38 lines (33 loc) · 1.08 KB
/
Copy pathShuffleChannel.cpp
File metadata and controls
38 lines (33 loc) · 1.08 KB
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
35
36
37
38
//
// Input.cpp
// MNNConverter
//
// Created by MNN on 2019/01/31.
// Copyright © 2018, Alibaba Group Holding Limited
//
#include "OpConverter.hpp"
#include "logkit.h"
class ShuffleChannel : public OpConverter {
public:
virtual void run(MNN::OpT* dstOp, const caffe::LayerParameter& parameters, const caffe::LayerParameter& weight);
virtual MNN::OpType opType() {
return MNN::OpType_PLUGIN;
}
virtual MNN::OpParameter type() {
return MNN::OpParameter_Plugin;
}
};
void ShuffleChannel::run(MNN::OpT* dstOp, const caffe::LayerParameter& parameters,
const caffe::LayerParameter& weight) {
auto plugin = new MNN::PluginT;
plugin->type = "ShuffleChannel";
plugin->buffer.resize(1);
plugin->buffer[0].reset(new MNN::BlobT);
auto blob = plugin->buffer[0].get();
blob->int32s = {1};
if (parameters.has_shuffle_channel_param()) {
blob->int32s = {(int)parameters.shuffle_channel_param().group()};
}
dstOp->main.value = plugin;
}
static OpConverterRegister<ShuffleChannel> a("ShuffleChannel");