diff --git a/lite/kernels/x86/conv_compute.h b/lite/kernels/x86/conv_compute.h index 48cb3c74ef3c05675115ab7cec09f16322d1410a..62f5887947f81c05e996ebcab7d625eef1740404 100644 --- a/lite/kernels/x86/conv_compute.h +++ b/lite/kernels/x86/conv_compute.h @@ -65,7 +65,7 @@ class Conv2dCompute : public KernelLite { col_shape_vec[j + 1 + data_dim] = output_shape_vec[j + 2]; } lite::DDim col_shape(col_shape_vec); - lite::DDim col_matrix_shape = col_shape.Flatten2D(data_dim + 1); + lite::DDim col_matrix_shape = col_shape.Flatten2D(data_dim); bool is_expand = IsExpand( filter_shape_vec, param.strides, param.paddings, param.dilations); lite::Tensor col; @@ -95,19 +95,14 @@ class Conv2dCompute : public KernelLite { auto blas = paddle::lite::x86::math::GetBlas(context); for (int i = 0; i < batch_size; i++) { - lite::Tensor in_batch; - lite::Tensor tmp_in_batch = param.x->Slice(i, i + 1); - tmp_in_batch.Resize(input_shape); - in_batch.ShareDataWith(tmp_in_batch); - lite::Tensor out_batch; - lite::Tensor tmp_out_batch = param.output->Slice(i, i + 1); - tmp_out_batch.Resize(output_matrix_shape); - out_batch.ShareDataWith(tmp_out_batch); + lite::Tensor in_batch = param.x->Slice(i, i + 1); + in_batch.Resize(input_shape); + lite::Tensor out_batch = param.output->Slice(i, i + 1); + out_batch.Resize(output_matrix_shape); for (int g = 0; g < param.groups; g++) { - lite::Tensor in_slice; - in_slice.ShareDataWith( + lite::Tensor in_slice = in_batch.Slice(static_cast(g * in_step), - static_cast((g + 1) * in_step))); + static_cast((g + 1) * in_step)); if (!is_expand) { col.ShareDataWith(in_slice); @@ -136,13 +131,13 @@ class Conv2dCompute : public KernelLite { // gemm lite::Tensor out_slice; - out_slice.ShareDataWith( + out_slice = out_batch.Slice(static_cast(g * out_step), - static_cast((g + 1) * out_step))); + static_cast((g + 1) * out_step)); lite::Tensor filter_slice; - filter_slice.ShareDataWith( + filter_slice = filter.Slice(static_cast(g * out_step), - static_cast((g + 1) * out_step))); + static_cast((g + 1) * out_step)); blas.MatMul(filter_slice, false, col_matrix, diff --git a/lite/tools/ci_build.sh b/lite/tools/ci_build.sh index 8be8e6e6b6da1e2aa38b6fcbcf95b23a8543a5be..6c3750e69fa6eb1ecc36a1fc7e42fe32bead377a 100755 --- a/lite/tools/ci_build.sh +++ b/lite/tools/ci_build.sh @@ -195,7 +195,6 @@ function test_server { # Due to the missing of x86 kernels, we skip the following tests temporarily. # TODO(xxx) clear the skip list latter local skip_list=("test_paddle_api" "test_cxx_api" - "test_mobilenetv1_lite_x86" "test_mobilenetv2_lite_x86" "test_light_api" "test_apis" "test_model_bin" )