1 #include "caffe2/mobile/contrib/arm-compute/core/context.h" 2 #include "caffe2/mobile/contrib/arm-compute/core/operator.h" 13 bool RunOnDevice()
override;
15 arm_compute::GCNormalizePlanarYUVLayer norm_layer_;
16 bool first_run_ =
true, second_run_ =
true;
17 GLContext::deleted_unique_ptr<const GLTensor<T>> X_, mean_, sd_;
22 auto Xblob = OperatorBase::Inputs()[0];
23 auto *meanblob = OperatorBase::Inputs()[1];
24 auto *sdblob = OperatorBase::Inputs()[2];
27 X_ = GLContext::getGLTensor<T>(Xblob);
28 mean_ = GLContext::getGLTensor<T>(meanblob);
29 sd_ = GLContext::getGLTensor<T>(sdblob);
32 CAFFE_ENFORCE_EQ(X_->ndim(), 4);
33 auto N = X_->dim32(0);
34 auto C = X_->dim32(1);
35 auto H = X_->dim32(2);
36 auto W = X_->dim32(3);
38 CAFFE_ENFORCE_EQ(C, mean_->dim32(1));
39 CAFFE_ENFORCE_EQ(C, sd_->dim32(1));
42 OperatorBase::Outputs()[0]->template GetMutable<GLTensor<T>>();
46 norm_layer_.configure(X_->get_underlying(), Y->get_underlying(), mean_->get_underlying(), sd_->get_underlying());
48 X_->lazy_allocate(Xblob, second_run_,
true);
49 mean_->lazy_allocate(meanblob, second_run_, second_run_);
50 sd_->lazy_allocate(sdblob, second_run_, second_run_);
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 ...