1 #include "caffe2/operators/conv_pool_op_base.h" 2 #include "caffe2/operators/deform_conv_op.h" 3 #include "caffe2/operators/deform_conv_op_impl.h" 7 OPERATOR_SCHEMA(DeformConvGradient).NumInputs(4, 4).NumOutputs(2, 4);
11 class GetDeformConvGradient :
public GradientMakerBase {
12 using GradientMakerBase::GradientMakerBase;
13 vector<OperatorDef> GetGradientDefs()
override {
14 CAFFE_ENFORCE(def_.input_size() == 3 || def_.input_size() == 4);
16 ArgumentHelper argsHelper(def_);
19 !argsHelper.GetSingleArgument<
bool>(
"no_gradient_to_input", 0);
21 if (def_.input_size() == 4) {
23 return SingleGradientDef(
26 vector<string>{I(0), I(1), I(2), GO(0)},
27 vector<string>{GI(1), GI(2), GI(3), GI(0)});
29 return SingleGradientDef(
32 vector<string>{I(0), I(1), I(2), GO(0)},
33 vector<string>{GI(1), GI(2), GI(3)});
37 return SingleGradientDef(
40 vector<string>{I(0), I(1), I(2), GO(0)},
41 vector<string>{GI(1), GI(2), GI(0)},
42 vector<Argument>{MakeArgument<int>(
"no_bias", 1)});
44 return SingleGradientDef(
47 vector<string>{I(0), I(1), I(2), GO(0)},
48 vector<string>{GI(1), GI(2)},
49 vector<Argument>{MakeArgument<int>(
"no_bias", 1)});
54 REGISTER_GRADIENT(DeformConv, GetDeformConvGradient);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...