1 #include "caffe2/operators/conv_transpose_op.h" 2 #include "caffe2/operators/conv_transpose_op_impl.h" 8 ConvTransposeGradientOp<float, CPUContext>);
10 OPERATOR_SCHEMA(ConvTransposeGradient).NumInputs(3).NumOutputs(1, 3);
13 using GradientMakerBase::GradientMakerBase;
14 vector<OperatorDef> GetGradientDefs()
override {
16 !ArgumentHelper::GetSingleArgument(def_,
"no_gradient_to_input",
false);
18 CAFFE_ENFORCE(3 == def_.input_size() || 2 == def_.input_size());
19 if (def_.input_size() == 3 && compute_dX) {
21 "ConvTransposeGradient",
23 vector<string>{I(0), I(1), GO(0)},
24 vector<string>{GI(1), GI(2), GI(0)});
25 }
else if (def_.input_size() == 3) {
27 "ConvTransposeGradient",
29 vector<string>{I(0), I(1), GO(0)},
30 vector<string>{GI(1), GI(2)});
31 }
else if (compute_dX) {
33 "ConvTransposeGradient",
35 vector<string>{I(0), I(1), GO(0)},
36 vector<string>{GI(1), GI(0)},
37 vector<Argument>{MakeArgument<bool>(
"no_bias",
true)});
40 "ConvTransposeGradient",
42 vector<string>{I(0), I(1), GO(0)},
43 vector<string>{GI(1)},
44 vector<Argument>{MakeArgument<bool>(
"no_bias",
true)});
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 ...