diff --git a/src/operators/kernel/central-arm-func/box_coder_arm_func.h b/src/operators/kernel/central-arm-func/box_coder_arm_func.h index eeb05f31b744c9e55e78375a495c5a5debf095c2..63558dea7b8d64d0fba3daae14e10c565f8feb2d 100644 --- a/src/operators/kernel/central-arm-func/box_coder_arm_func.h +++ b/src/operators/kernel/central-arm-func/box_coder_arm_func.h @@ -16,6 +16,8 @@ limitations under the License. */ #pragma once #include +#include "framework/tensor.h" +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { @@ -122,7 +124,7 @@ void BoxCoderCompute(const BoxCoderParam& param) { auto col = input_priorbox->dims()[0]; auto len = input_priorbox->dims()[1]; - Tensor* output_box = param.OutputBox(); + framework::Tensor* output_box = param.OutputBox(); auto* output_box_dataptr = output_box->mutable_data({row, col, len}); if (code_type == "encode_center_size") { diff --git a/src/operators/kernel/central-arm-func/conv_add_bn_relu_arm_func.h b/src/operators/kernel/central-arm-func/conv_add_bn_relu_arm_func.h index d3b5bc69760797c4efcc3fb77831d54676d7d5b1..2683b078889059f10b85c1e9fe74374342689418 100644 --- a/src/operators/kernel/central-arm-func/conv_add_bn_relu_arm_func.h +++ b/src/operators/kernel/central-arm-func/conv_add_bn_relu_arm_func.h @@ -18,6 +18,9 @@ limitations under the License. */ #include #include "operators/math/depthwise_conv_3x3.h" +#include "operators/math/im2col.h" +#include "operators/math/math_function.h" +#include "operators/math/vol2col.h" #include "operators/op_param.h" namespace paddle_mobile { diff --git a/src/operators/kernel/central-arm-func/conv_add_relu_arm_func.h b/src/operators/kernel/central-arm-func/conv_add_relu_arm_func.h index 363927ab8e257c74061067b88dcd5a49b322ae72..177c275224b3ccbd5fa31efc2fab4bfa8033b752 100644 --- a/src/operators/kernel/central-arm-func/conv_add_relu_arm_func.h +++ b/src/operators/kernel/central-arm-func/conv_add_relu_arm_func.h @@ -16,6 +16,10 @@ limitations under the License. */ #pragma once #include +#include "operators/math/conv_func.h" +#include "operators/math/im2col.h" +#include "operators/math/math_function.h" +#include "operators/math/vol2col.h" #include "operators/op_param.h" namespace paddle_mobile { diff --git a/src/operators/kernel/central-arm-func/conv_bn_relu_arm_func.h b/src/operators/kernel/central-arm-func/conv_bn_relu_arm_func.h index f18d67749b96cd0ee2d84c2731af8a2c3e136db1..9ec74b1d6ede34cf889c5999df1e902bb9ece4f3 100644 --- a/src/operators/kernel/central-arm-func/conv_bn_relu_arm_func.h +++ b/src/operators/kernel/central-arm-func/conv_bn_relu_arm_func.h @@ -17,6 +17,9 @@ limitations under the License. */ #pragma once #include #include "operators/math/depthwise_conv_3x3.h" +#include "operators/math/im2col.h" +#include "operators/math/math_function.h" +#include "operators/math/vol2col.h" #include "operators/op_param.h" namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/central-arm-func/dwconv_bn_relu_arm_func.h b/src/operators/kernel/central-arm-func/dwconv_bn_relu_arm_func.h index 7693da2a84c15b8f7b6953eb51e2765b5ea159f8..2166fd2a97846dc10733e89a999407afc79e888b 100644 --- a/src/operators/kernel/central-arm-func/dwconv_bn_relu_arm_func.h +++ b/src/operators/kernel/central-arm-func/dwconv_bn_relu_arm_func.h @@ -17,6 +17,9 @@ limitations under the License. */ #pragma once #include #include "operators/math/depthwise_conv_3x3.h" +#include "operators/math/im2col.h" +#include "operators/math/math_function.h" +#include "operators/math/vol2col.h" #include "operators/op_param.h" namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/central-arm-func/elementwise_add_arm_func.h b/src/operators/kernel/central-arm-func/elementwise_add_arm_func.h index 8b3f5d0a8083b63334319b2054f9bf463efa66c7..91150cfb8c206521fd628c972ab8b35400b5ff53 100644 --- a/src/operators/kernel/central-arm-func/elementwise_add_arm_func.h +++ b/src/operators/kernel/central-arm-func/elementwise_add_arm_func.h @@ -15,6 +15,8 @@ limitations under the License. */ #ifdef ELEMENTWISEADD_OP #pragma once +#include "operators/math/elementwise_op_function.h" +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/central-arm-func/fusion_fc_arm_func.h b/src/operators/kernel/central-arm-func/fusion_fc_arm_func.h index 8a01f554140712c6a941b40372cbcfe35a951ce7..431124feb4f7baddf102dcbfad5e53b0c2002dda 100644 --- a/src/operators/kernel/central-arm-func/fusion_fc_arm_func.h +++ b/src/operators/kernel/central-arm-func/fusion_fc_arm_func.h @@ -15,6 +15,8 @@ limitations under the License. */ #ifdef FUSION_FC_OP #pragma once +#include "operators/math/math_function.h" +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/central-arm-func/lrn_arm_func.h b/src/operators/kernel/central-arm-func/lrn_arm_func.h index 52bb1b67dee83c28f513649a8763034a8d538d73..15c279d1605ed7348b766855497411fbe541e2f6 100644 --- a/src/operators/kernel/central-arm-func/lrn_arm_func.h +++ b/src/operators/kernel/central-arm-func/lrn_arm_func.h @@ -15,7 +15,7 @@ limitations under the License. */ #ifdef LRN_OP #pragma once - +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/central-arm-func/multiclass_nms_arm_func.h b/src/operators/kernel/central-arm-func/multiclass_nms_arm_func.h index 8833f012d97390e758ac6fc394ef237cb86632b1..ccc99c13c673fb42d151da6db3372848f5d8bd7c 100644 --- a/src/operators/kernel/central-arm-func/multiclass_nms_arm_func.h +++ b/src/operators/kernel/central-arm-func/multiclass_nms_arm_func.h @@ -19,6 +19,8 @@ limitations under the License. */ #include #include #include +#include "framework/tensor.h" +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { @@ -89,7 +91,8 @@ static inline T JaccardOverlap(const T* box1, const T* box2, } template -static inline void NMSFast(const Tensor& bbox, const Tensor& scores, +static inline void NMSFast(const framework::Tensor& bbox, + const framework::Tensor& scores, const T score_threshold, const T nms_threshold, const T eta, const int64_t top_k, std::vector* selected_indices) { @@ -131,7 +134,8 @@ static inline void NMSFast(const Tensor& bbox, const Tensor& scores, } template -void MultiClassNMS(const Tensor& scores, const Tensor& bboxes, +void MultiClassNMS(const framework::Tensor& scores, + const framework::Tensor& bboxes, std::map>* indices, int* num_nmsed_out, const int& background_label, const int& nms_top_k, const int& keep_top_k, const T& nms_threshold, @@ -141,7 +145,7 @@ void MultiClassNMS(const Tensor& scores, const Tensor& bboxes, int num_det = 0; for (int64_t c = 0; c < class_num; ++c) { if (c == background_label) continue; - Tensor score = scores.Slice(c, c + 1); + framework::Tensor score = scores.Slice(c, c + 1); /// [c] is key NMSFast(bboxes, score, score_threshold, nms_threshold, nms_eta, nms_top_k, &((*indices)[c])); @@ -181,9 +185,10 @@ void MultiClassNMS(const Tensor& scores, const Tensor& bboxes, } template -void MultiClassOutput(const Tensor& scores, const Tensor& bboxes, +void MultiClassOutput(const framework::Tensor& scores, + const framework::Tensor& bboxes, const std::map>& selected_indices, - Tensor* outs) { + framework::Tensor* outs) { int predict_dim = scores.dims()[1]; auto* scores_data = scores.data(); auto* bboxes_data = bboxes.data(); @@ -231,10 +236,10 @@ void MultiClassNMSCompute(const MultiClassNMSParam& param) { std::vector>> all_indices; std::vector batch_starts = {0}; for (int64_t i = 0; i < batch_size; ++i) { - Tensor ins_score = input_scores->Slice(i, i + 1); + framework::Tensor ins_score = input_scores->Slice(i, i + 1); ins_score.Resize({class_num, predict_dim}); - Tensor ins_boxes = input_bboxes->Slice(i, i + 1); + framework::Tensor ins_boxes = input_bboxes->Slice(i, i + 1); ins_boxes.Resize({predict_dim, box_dim}); std::map> indices; @@ -253,16 +258,16 @@ void MultiClassNMSCompute(const MultiClassNMSParam& param) { } else { outs->mutable_data({num_kept, kOutputDim}); for (int64_t i = 0; i < batch_size; ++i) { - Tensor ins_score = input_scores->Slice(i, i + 1); + framework::Tensor ins_score = input_scores->Slice(i, i + 1); ins_score.Resize({class_num, predict_dim}); - Tensor ins_boxes = input_bboxes->Slice(i, i + 1); + framework::Tensor ins_boxes = input_bboxes->Slice(i, i + 1); ins_boxes.Resize({predict_dim, box_dim}); int64_t s = batch_starts[i]; int64_t e = batch_starts[i + 1]; if (e > s) { - Tensor out = outs->Slice(s, e); + framework::Tensor out = outs->Slice(s, e); MultiClassOutput(ins_score, ins_boxes, all_indices[i], &out); } } diff --git a/src/operators/kernel/central-arm-func/relu_arm_func.h b/src/operators/kernel/central-arm-func/relu_arm_func.h index 19ccb3e862a29cab79453572b24ed0c5a2a8301d..c1002c1f10e9c2d72d764693384500c4793dda46 100644 --- a/src/operators/kernel/central-arm-func/relu_arm_func.h +++ b/src/operators/kernel/central-arm-func/relu_arm_func.h @@ -16,6 +16,7 @@ limitations under the License. */ #pragma once #include +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/central-arm-func/reshape_arm_func.h b/src/operators/kernel/central-arm-func/reshape_arm_func.h index a2fb836257418923f41e94ceaf499e38033c6b4c..aa0a3a7c6b5a58938af1c5917c8c2fa0de3f9e90 100644 --- a/src/operators/kernel/central-arm-func/reshape_arm_func.h +++ b/src/operators/kernel/central-arm-func/reshape_arm_func.h @@ -16,6 +16,8 @@ limitations under the License. */ #pragma once #include +#include "operators/kernel/reshape_kernel.h" +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { diff --git a/src/operators/kernel/central-arm-func/softmax_arm_func.h b/src/operators/kernel/central-arm-func/softmax_arm_func.h index 5a60bf88ae5d936567dc096c1f4bb31a73f0ef34..896532109409d316346ba4a8d14aaa85a500b007 100644 --- a/src/operators/kernel/central-arm-func/softmax_arm_func.h +++ b/src/operators/kernel/central-arm-func/softmax_arm_func.h @@ -15,6 +15,7 @@ limitations under the License. */ #ifdef SOFTMAX_OP #pragma once #include "../../math/softmax.h" +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { template diff --git a/src/operators/kernel/central-arm-func/transpose_arm_func.h b/src/operators/kernel/central-arm-func/transpose_arm_func.h index 1cbebc4525113374061541518775a94c6a64401f..43a16d0e85ff058764b5a711283e38e15eccae57 100644 --- a/src/operators/kernel/central-arm-func/transpose_arm_func.h +++ b/src/operators/kernel/central-arm-func/transpose_arm_func.h @@ -16,6 +16,7 @@ limitations under the License. */ #pragma once #include +#include "operators/op_param.h" namespace paddle_mobile { namespace operators {