Caffe2 - C++ API
A deep learning, cross platform ML framework
channel_shuffle_op.cc
1 #include "channel_shuffle_op.h"
2 
3 namespace caffe2 {
4 
6  using GradientMakerBase::GradientMakerBase;
7  vector<OperatorDef> GetGradientDefs() override {
8  return SingleGradientDef(
9  def_.type() + "Gradient",
10  "",
11  vector<string>{GO(0)},
12  vector<string>{GI(0)});
13  }
14 };
15 
16 REGISTER_CPU_OPERATOR(ChannelShuffle, ChannelShuffleOp<CPUContext>);
17 REGISTER_CPU_OPERATOR(
18  ChannelShuffleGradient,
20 REGISTER_GRADIENT(ChannelShuffle, GetChannelShuffleGradient);
21 OPERATOR_SCHEMA(ChannelShuffle)
22  .IdenticalTypeAndShape()
23  .NumInputs(1)
24  .NumOutputs(1)
25  .InheritOnnxSchema("ChannelShuffle");
26 OPERATOR_SCHEMA(ChannelShuffleGradient)
27  .IdenticalTypeAndShape()
28  .NumInputs(1)
29  .NumOutputs(1);
30 }
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
static vector< OperatorDef > SingleGradientDef(const Args &...args)
a helper function to allow one to create one single operator def, which is usually the case for many ...