1 #include "caffe2/mobile/contrib/arm-compute/core/context.h" 2 #include "caffe2/mobile/contrib/arm-compute/core/operator.h" 12 bool RunOnDevice()
override;
14 bool first_run_ =
true, second_run_ =
true;
15 std::vector<GLContext::deleted_unique_ptr<const GLTensor<T>>> inputs_;
21 auto *X0blob = OperatorBase::Inputs()[0];
22 auto X0 = GLContext::getGLTensor<T>(X0blob);
25 inputs_.push_back(std::move(X0));
27 std::vector<const Blob*> inputsBlob;
28 inputsBlob.push_back(X0blob);
31 for (
int i = 1; i < Inputs().size(); ++i) {
32 auto *Xblob = OperatorBase::Inputs()[i];
33 auto X = GLContext::getGLTensor<T>(Xblob);
34 inputs_.push_back(std::move(X));
38 for (
int i = 1; i < Inputs().size(); ++i) {
39 auto *Xblob = OperatorBase::Inputs()[i];
40 inputsBlob.push_back(Xblob);
46 for (
int i = 0; i < inputs_.size(); ++i) {
47 auto* X = inputs_[i].get();
48 auto* Xblob = inputsBlob[i];
49 X->lazy_allocate(Xblob, second_run_, second_run_);
55 for (
auto i = 0; i < Inputs().size(); ++i) {
57 auto* Xblob = inputsBlob[i];
59 auto* X = inputs_[i].get();
60 Output(i)->
Resize(X->dims());
61 Output(i)->template mutable_data<float>();
63 CAFFE_ENFORCE_EQ(Output(i)->nbytes(), X->size() *
sizeof(float));
64 getTensorCPU(*X, *(OperatorBase::Outputs()[i]->
template GetMutable<TensorCPU>()));
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
void Resize(Ts...dim_source)
Resizes a tensor.
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...