1 #include "caffe2/operators/negate_gradient_op.h" 5 REGISTER_CPU_OPERATOR(NegateGradient, NegateGradientOp<CPUContext>);
6 OPERATOR_SCHEMA(NegateGradient)
9 .AllowInplace({{0, 0}})
11 NegagteGradient operator in forward pass simply copies input to the 12 output, and in backward pass, flips the sign of the output gradient 16 using GradientMakerBase::GradientMakerBase;
17 std::vector<OperatorDef> GetGradientDefs()
override {
18 CAFFE_ENFORCE_EQ(def_.input_size(), 1);
20 "Negative",
"", vector<string>{GO(0)}, vector<string>{GI(0)});
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 ...