17 #include "affine_channel_op.h" 21 REGISTER_CPU_OPERATOR(AffineChannel,
22 AffineChannelOp<float, CPUContext>);
23 REGISTER_CPU_OPERATOR(AffineChannelGradient,
24 AffineChannelGradientOp<float, CPUContext>);
26 OPERATOR_SCHEMA(AffineChannel)
29 .AllowInplace({{0, 0}})
31 Applies a separate affine transformation to each channel of the input. Useful 32 for replacing spatial batch norm with its equivalent fixed transformation. 37 "4D feature map input of shape (N, C, H, W).")
41 "1D input of shape (C); the c-th element is the scale factor of the " 42 "affine transformation for the c-th channel of the input.")
46 "1D input of shape (C); the c-th element is the bias of the affine " 47 "transformation for the c-th channel of the input.")
51 "4D output of shape (N, C, H, W).");
53 OPERATOR_SCHEMA(AffineChannelGradient)
56 .AllowInplace({{1, 0}})
64 "Gradient of forward output 0 (Y)")
68 "Gradient of forward input 0 (X)");
71 using GradientMakerBase::GradientMakerBase;
72 vector<OperatorDef> GetGradientDefs()
override {
74 "AffineChannelGradient",
"",
75 vector<string>{I(1), GO(0)},
76 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 ...