From 72afff3621812c0f3fd33e3f23173a2f79b893f4 Mon Sep 17 00:00:00 2001 From: hong19860320 <9973393+hong19860320@users.noreply.github.com> Date: Thu, 17 Sep 2020 10:19:08 +0800 Subject: [PATCH] [NPU] Fix build error caused by flatbuffer if the target is tiny_publish (#4340) --- lite/kernels/apu/bridges/conv_op.cc | 4 ++-- lite/kernels/apu/bridges/pool_op.cc | 2 +- lite/kernels/npu/bridges/conv_op.cc | 4 ++-- lite/kernels/npu/bridges/conv_transpose_op.cc | 4 ++-- lite/kernels/npu/bridges/pad2d_op.cc | 2 +- lite/kernels/npu/bridges/pool_op.cc | 2 +- lite/kernels/npu/bridges/reduce_mean_op.cc | 2 +- lite/kernels/rknpu/bridges/conv_op.cc | 4 ++-- lite/kernels/rknpu/bridges/pool_op.cc | 2 +- lite/kernels/xpu/bridges/conv_op.cc | 4 ++-- lite/kernels/xpu/bridges/pool_op.cc | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lite/kernels/apu/bridges/conv_op.cc b/lite/kernels/apu/bridges/conv_op.cc index bdac473b1b..1c3020065e 100644 --- a/lite/kernels/apu/bridges/conv_op.cc +++ b/lite/kernels/apu/bridges/conv_op.cc @@ -60,9 +60,9 @@ int ConvConverter(void* ctx, OpLite* op, KernelBase* kernel) { CHECK_EQ(output_dims[0], bs); CHECK_EQ(output_dims[1], oc); auto strides = op_info->GetAttr>("strides"); - auto paddings = op_info->GetAttr>("paddings"); + std::vector paddings = op_info->GetAttr>("paddings"); auto groups = op_info->GetAttr("groups"); - auto dilations = op_info->GetAttr>("dilations"); + std::vector dilations = op_info->GetAttr>("dilations"); bool with_act = op_info->HasAttr("with_act") && op_info->GetAttr("with_act"); std::string act_type = diff --git a/lite/kernels/apu/bridges/pool_op.cc b/lite/kernels/apu/bridges/pool_op.cc index 594c7fabda..e255518044 100644 --- a/lite/kernels/apu/bridges/pool_op.cc +++ b/lite/kernels/apu/bridges/pool_op.cc @@ -45,7 +45,7 @@ int PoolConverter(void* ctx, OpLite* op, KernelBase* kernel) { auto pooling_type = op_info->GetAttr("pooling_type"); auto global_pooling = op_info->GetAttr("global_pooling"); auto ksize = op_info->GetAttr>("ksize"); - auto paddings = op_info->GetAttr>("paddings"); + std::vector paddings = op_info->GetAttr>("paddings"); // pool mode if ((pooling_type == "max") || (pooling_type == "avg")) { diff --git a/lite/kernels/npu/bridges/conv_op.cc b/lite/kernels/npu/bridges/conv_op.cc index 5cc79137b9..95632c7a05 100644 --- a/lite/kernels/npu/bridges/conv_op.cc +++ b/lite/kernels/npu/bridges/conv_op.cc @@ -53,9 +53,9 @@ int ConvConverter(void* ctx, OpLite* op, KernelBase* kernel) { CHECK_EQ(output_dims[0], bs); CHECK_EQ(output_dims[1], oc); auto strides = op_info->GetAttr>("strides"); - auto paddings = op_info->GetAttr>("paddings"); + std::vector paddings = op_info->GetAttr>("paddings"); auto groups = op_info->GetAttr("groups"); - auto dilations = op_info->GetAttr>("dilations"); + std::vector dilations = op_info->GetAttr>("dilations"); bool with_act = op_info->HasAttr("with_act") && op_info->GetAttr("with_act"); std::string act_type = diff --git a/lite/kernels/npu/bridges/conv_transpose_op.cc b/lite/kernels/npu/bridges/conv_transpose_op.cc index 7e149ed243..52ae137d52 100644 --- a/lite/kernels/npu/bridges/conv_transpose_op.cc +++ b/lite/kernels/npu/bridges/conv_transpose_op.cc @@ -59,8 +59,8 @@ int ConvTransposeConverter(void* ctx, OpLite* op, KernelBase* kernel) { output_size = op_info->GetAttr>("output_size"); } - auto paddings = op_info->GetAttr>("paddings"); - auto dilations = op_info->GetAttr>("dilations"); + std::vector paddings = op_info->GetAttr>("paddings"); + std::vector dilations = op_info->GetAttr>("dilations"); CHECK_EQ(dilations.size(), 2L); std::string padding_algorithm = op_info->HasAttr("padding_algorithm") diff --git a/lite/kernels/npu/bridges/pad2d_op.cc b/lite/kernels/npu/bridges/pad2d_op.cc index 70fa87e778..cb35b24752 100644 --- a/lite/kernels/npu/bridges/pad2d_op.cc +++ b/lite/kernels/npu/bridges/pad2d_op.cc @@ -35,7 +35,7 @@ int Pad2dConverter(void* ctx, OpLite* op, KernelBase* kernel) { auto x = scope->FindMutableTensor(x_name); auto x_dims = x->dims(); auto out_name = op_info->Output("Out").front(); - auto padding = op_info->GetAttr>("paddings"); + std::vector padding = op_info->GetAttr>("paddings"); CHECK_EQ(padding.size(), 4); // X node diff --git a/lite/kernels/npu/bridges/pool_op.cc b/lite/kernels/npu/bridges/pool_op.cc index fc2647f67e..921e1a2571 100644 --- a/lite/kernels/npu/bridges/pool_op.cc +++ b/lite/kernels/npu/bridges/pool_op.cc @@ -39,7 +39,7 @@ int PoolConverter(void* ctx, OpLite* op, KernelBase* kernel) { auto pooling_type = op_info->GetAttr("pooling_type"); auto global_pooling = op_info->GetAttr("global_pooling"); auto ksize = op_info->GetAttr>("ksize"); - auto paddings = op_info->GetAttr>("paddings"); + std::vector paddings = op_info->GetAttr>("paddings"); // X node std::shared_ptr x_node = nullptr; diff --git a/lite/kernels/npu/bridges/reduce_mean_op.cc b/lite/kernels/npu/bridges/reduce_mean_op.cc index 5987342672..a608082be0 100644 --- a/lite/kernels/npu/bridges/reduce_mean_op.cc +++ b/lite/kernels/npu/bridges/reduce_mean_op.cc @@ -36,7 +36,7 @@ int ReduceMeanConverter(void* ctx, OpLite* op, KernelBase* kernel) { auto x_dims = x->dims(); auto out_name = op_info->Input("Out").front(); auto keep_dim = op_info->GetAttr("keep_dim"); - auto dim = op_info->GetAttr>("dim"); + std::vector dim = op_info->GetAttr>("dim"); CHECK(!dim.empty()) << "[NPU] \"dim\" of reduce_mean should not be empty."; for (size_t i = 0; i < dim.size(); i++) { if (dim[i] < 0) { diff --git a/lite/kernels/rknpu/bridges/conv_op.cc b/lite/kernels/rknpu/bridges/conv_op.cc index 134d9e0cde..a789f0bacc 100644 --- a/lite/kernels/rknpu/bridges/conv_op.cc +++ b/lite/kernels/rknpu/bridges/conv_op.cc @@ -51,9 +51,9 @@ int ConvConverter(void* ctx, OpLite* op, KernelBase* kernel) { CHECK_EQ(output_dims[0], bs); CHECK_EQ(output_dims[1], oc); auto strides = op_info->GetAttr>("strides"); - auto paddings = op_info->GetAttr>("paddings"); + std::vector paddings = op_info->GetAttr>("paddings"); auto groups = op_info->GetAttr("groups"); - auto dilations = op_info->GetAttr>("dilations"); + std::vector dilations = op_info->GetAttr>("dilations"); auto fuse_relu = op_info->GetAttr("fuse_relu"); CHECK_EQ(strides.size(), 2L); CHECK_EQ(dilations.size(), 2L); diff --git a/lite/kernels/rknpu/bridges/pool_op.cc b/lite/kernels/rknpu/bridges/pool_op.cc index 36832fc578..1a5a69b134 100644 --- a/lite/kernels/rknpu/bridges/pool_op.cc +++ b/lite/kernels/rknpu/bridges/pool_op.cc @@ -42,7 +42,7 @@ int PoolConverter(void* ctx, OpLite* op, KernelBase* kernel) { auto pooling_type = op_info->GetAttr("pooling_type"); auto global_pooling = op_info->GetAttr("global_pooling"); auto ksize = op_info->GetAttr>("ksize"); - auto paddings = op_info->GetAttr>("paddings"); + std::vector paddings = op_info->GetAttr>("paddings"); // for quantization bool enable_int8 = false; diff --git a/lite/kernels/xpu/bridges/conv_op.cc b/lite/kernels/xpu/bridges/conv_op.cc index a4c0bc05cb..590d830ce4 100644 --- a/lite/kernels/xpu/bridges/conv_op.cc +++ b/lite/kernels/xpu/bridges/conv_op.cc @@ -44,9 +44,9 @@ int ConvConverter(void* ctx, OpLite* op, KernelBase* kernel) { CHECK_EQ(input_dims.size(), 4); CHECK_EQ(filter_dims.size(), 4); auto strides = op_info->GetAttr>("strides"); - auto paddings = op_info->GetAttr>("paddings"); + std::vector paddings = op_info->GetAttr>("paddings"); auto groups = op_info->GetAttr("groups"); - auto dilations = op_info->GetAttr>("dilations"); + std::vector dilations = op_info->GetAttr>("dilations"); auto fuse_relu = op_info->GetAttr("fuse_relu"); CHECK_EQ(strides.size(), 2L); CHECK_EQ(dilations.size(), 2L); diff --git a/lite/kernels/xpu/bridges/pool_op.cc b/lite/kernels/xpu/bridges/pool_op.cc index 862e1841e8..5c38cacddd 100644 --- a/lite/kernels/xpu/bridges/pool_op.cc +++ b/lite/kernels/xpu/bridges/pool_op.cc @@ -37,7 +37,7 @@ int PoolConverter(void* ctx, OpLite* op, KernelBase* kernel) { auto out_name = op_info->Output("Out").front(); auto pooling_type = op_info->GetAttr("pooling_type"); auto ceil_mode = op_info->GetAttr("ceil_mode"); - auto paddings = op_info->GetAttr>("paddings"); + std::vector paddings = op_info->GetAttr>("paddings"); auto global_pooling = op_info->GetAttr("global_pooling"); auto ksize = op_info->GetAttr>("ksize"); auto strides = op_info->GetAttr>("strides"); -- GitLab