Caffe2 - C++ API
A deep learning, cross platform ML framework
elementwise_add_gradient_op.cc
1 #include "caffe2/operators/elementwise_add_op.h"
2 
3 #include <string>
4 #include <vector>
5 
6 namespace caffe2 {
7 
8 REGISTER_CPU_OPERATOR(
9  AddGradient,
10  BinaryElementwiseGradientOp<
11  NumericTypes,
12  CPUContext,
13  AddFunctor<CPUContext>>);
14 
15 namespace {
16 
17 class GetAddGradient final : public GradientMakerBase {
18  using GradientMakerBase::GradientMakerBase;
19 
20  std::vector<OperatorDef> GetGradientDefs() override {
21  return SingleGradientDef(
22  "AddGradient",
23  "",
24  std::vector<std::string>{GO(0), I(0), I(1)},
25  std::vector<std::string>{GI(0), GI(1)});
26  }
27 };
28 
29 } // namespace
30 
31 REGISTER_GRADIENT(Add, GetAddGradient);
32 
33 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13
Definition: OpClasses.h:659