1 #include <caffe2/ideep/ideep_utils.h> 7 USE_IDEEP_DEF_ALIASES();
8 USE_IDEEP_OPERATOR_FUNCTIONS();
12 size_(OperatorBase::GetSingleArgument<int>(
"size", 0)),
13 alpha_(OperatorBase::GetSingleArgument<float>(
"alpha", 0)),
14 beta_(OperatorBase::GetSingleArgument<float>(
"beta", 0)),
15 bias_(OperatorBase::GetSingleArgument<float>(
"bias", 1)),
16 pre_pad_((size_ - 1) / 2) {
18 DCHECK_EQ(size_ % 2, 1);
24 bool RunOnDevice()
override {
25 auto& X = Input(INPUT);
26 auto* Y = Output(OUTPUT);
28 ideep::lrn_forward::compute(X, *Y, size_, alpha_, beta_, bias_);
46 USE_IDEEP_DEF_ALIASES();
47 USE_IDEEP_OPERATOR_FUNCTIONS();
51 size_(OperatorBase::GetSingleArgument<int>(
"size", 0)),
52 alpha_(OperatorBase::GetSingleArgument<float>(
"alpha", 0)),
53 beta_(OperatorBase::GetSingleArgument<float>(
"beta", 0)),
54 bias_(OperatorBase::GetSingleArgument<float>(
"bias", 1)),
55 pre_pad_((size_ - 1) / 2) {
57 DCHECK_EQ(size_ % 2, 1);
63 bool RunOnDevice()
override {
64 const auto& X = Input(INPUT);
65 const auto& Y = Input(FILTER);
66 const auto& dY = Input(OUTPUT_GRAD);
67 auto* dX = Output(INPUT_GRAD);
69 ideep::lrn_backward::compute(X, dY, Y, *dX, size_, alpha_, beta_, bias_);
81 INPUT_TAGS(INPUT, FILTER, OUTPUT_GRAD);
82 OUTPUT_TAGS(INPUT_GRAD);
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...