17 #include "upsample_nearest_op.h" 18 #ifdef CAFFE2_USE_MKLDNN 19 #include "caffe2/ideep/operators/operator_fallback_ideep.h" 20 #include "caffe2/ideep/utils/ideep_operator.h" 24 #ifdef CAFFE2_USE_MKLDNN 25 REGISTER_IDEEP_OPERATOR(
27 IDEEPFallbackOp<UpsampleNearestOp<float, CPUContext>>);
30 REGISTER_CPU_OPERATOR(UpsampleNearest, UpsampleNearestOp<float, CPUContext>);
31 REGISTER_CPU_OPERATOR(
32 UpsampleNearestGradient,
33 UpsampleNearestGradientOp<float, CPUContext>);
35 OPERATOR_SCHEMA(UpsampleNearest)
39 Nearest neighbor upsampling operation. Implementation taken from THCUNN. 43 "(int) default 2; integer upsampling factor.")
47 "4D feature map input of shape (N, C, H, W).")
51 "4D feature map of shape (N, C, scale * H, scale * W); Values are " 52 "neareast neighbor samples from X.");
54 OPERATOR_SCHEMA(UpsampleNearestGradient)
60 "See UpsampleNearest.")
64 "Gradient of forward output 0 (Y).")
68 "Gradient of forward input 0 (X).");
71 using GradientMakerBase::GradientMakerBase;
72 vector<OperatorDef> GetGradientDefs()
override {
74 "UpsampleNearestGradient",
76 vector<string>{I(0), GO(0)},
77 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 ...