Caffe2 - C++ API
A deep learning, cross platform ML framework
tt_pad_op.cc
1 #include "caffe2/experiments/operators/tt_pad_op.h"
2 
3 namespace caffe2 {
4 namespace {
5 
6 REGISTER_CPU_OPERATOR(TTPad, TTPadOp<float, CPUContext>);
7 OPERATOR_SCHEMA(TTPad).NumInputs(1).NumOutputs(2).EnforceInplace({{0, 0}});
8 
9 REGISTER_CPU_OPERATOR(TTPadGradient, TTPadGradientOp<float, CPUContext>);
10 OPERATOR_SCHEMA(TTPadGradient)
11  .NumInputs(2)
12  .NumOutputs(1)
13  .EnforceInplace({{0, 0}});
14 
15 class GetTTPadGradient : public GradientMakerBase {
16  using GradientMakerBase::GradientMakerBase;
17  vector<OperatorDef> GetGradientDefs() override {
18  return SingleGradientDef(
19  "TTPadGradient",
20  "",
21  vector<string>{GO(0), O(1)},
22  vector<string>{GI(0)},
23  Def().arg());
24  }
25 };
26 
27 REGISTER_GRADIENT(TTPad, GetTTPadGradient);
28 
29 } // namespace
30 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...