17 #include "upsample_nearest_op.h" 21 REGISTER_CPU_OPERATOR(UpsampleNearest, UpsampleNearestOp<float, CPUContext>);
22 REGISTER_CPU_OPERATOR(
23 UpsampleNearestGradient,
24 UpsampleNearestGradientOp<float, CPUContext>);
26 OPERATOR_SCHEMA(UpsampleNearest)
30 Nearest neighbor upsampling operation. Implementation taken from THCUNN. 34 "(int) default 2; integer upsampling factor.")
38 "4D feature map input of shape (N, C, H, W).")
42 "4D feature map of shape (N, C, scale * H, scale * W); Values are " 43 "neareast neighbor samples from X.");
45 OPERATOR_SCHEMA(UpsampleNearestGradient)
51 "See UpsampleNearest.")
55 "Gradient of forward output 0 (Y).")
59 "Gradient of forward input 0 (X).");
62 using GradientMakerBase::GradientMakerBase;
63 vector<OperatorDef> GetGradientDefs()
override {
65 "UpsampleNearestGradient",
67 vector<string>{I(0), GO(0)},
68 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 ...