Skip to content

Commit

Permalink
code style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Jan 28, 2018
1 parent 03621aa commit f133729
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
14 changes: 14 additions & 0 deletions src/layer/shufflechannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ namespace ncnn {

DEFINE_LAYER_CREATOR(ShuffleChannel)

ShuffleChannel::ShuffleChannel()
{
one_blob_only = true;
support_inplace = false;
}

int ShuffleChannel::load_param(const ParamDict& pd)
{
group = pd.get(0, 1);

return 0;
}

int ShuffleChannel::forward(const Mat &bottom_blob, Mat &top_blob) const
{
int c = bottom_blob.c;
Expand All @@ -31,6 +44,7 @@ int ShuffleChannel::forward(const Mat &bottom_blob, Mat &top_blob) const
// reject invalid group
return -100;
}

top_blob.create(w, h, c);
if (top_blob.empty())
return -100;
Expand Down
12 changes: 4 additions & 8 deletions src/layer/shufflechannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ namespace ncnn {
class ShuffleChannel : public Layer
{
public:
ShuffleChannel() {
one_blob_only = true;
support_inplace = false;
}
virtual int load_param(const ParamDict& pd) {
group = pd.get(0, 1);
return 0;
}
ShuffleChannel();

virtual int load_param(const ParamDict& pd);

virtual int forward(const Mat& bottom_blob, Mat& top_blob) const;

public:
Expand Down

0 comments on commit f133729

Please sign in to comment.