17 #include "spatial_narrow_as_op.h" 21 REGISTER_CPU_OPERATOR(SpatialNarrowAs, SpatialNarrowAsOp<CPUContext>);
22 REGISTER_CPU_OPERATOR(
23 SpatialNarrowAsGradient,
24 SpatialNarrowAsGradientOp<CPUContext>);
26 OPERATOR_SCHEMA(SpatialNarrowAs)
30 Reduces ("narrows") the spatial extent of A to that of B by removing rows and 31 columns from the bottom and right. 36 "3D or 4D input of shape (N, H0, W0) or (N, C, H0, W0).")
40 "3D or 4D input of shape (N, H1, W1) or (N, C, H1, W1), where H1 <= H0 " 45 "Sub window of A containing rows [0, H1 - 1] (inclusive) and columns " 46 "[0, W1 - 1] (inclusive).");
48 OPERATOR_SCHEMA(SpatialNarrowAsGradient)
54 "See SpatialNarrowAs.")
58 "See SpatialNarrowAs.")
62 "Gradient of forward output 0 (C).")
66 "Gradient of forward input 0 (A)");
69 using GradientMakerBase::GradientMakerBase;
70 vector<OperatorDef> GetGradientDefs()
override {
72 "SpatialNarrowAsGradient",
"",
73 vector<string>{I(0), I(1), GO(0)},
74 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 ...