diff --git a/paddle/fluid/operators/detection/multiclass_nms_op.cc b/paddle/fluid/operators/detection/multiclass_nms_op.cc index 9dc6a8cc1f29ecb574804f0916c91620f9c73376..ed5fca119cf9ee94a1ad1aa2b7959e485eb143a0 100644 --- a/paddle/fluid/operators/detection/multiclass_nms_op.cc +++ b/paddle/fluid/operators/detection/multiclass_nms_op.cc @@ -361,7 +361,7 @@ class MultiClassNMSKernel : public framework::OpKernel { auto index = ctx.Output("Index"); bool has_roisnum = ctx.HasInput("RoisNum") ? true : false; auto rois_num = ctx.Input("RoisNum"); - auto score_dims = scores->dims(); + auto score_dims = phi::vectorize(scores->dims()); auto score_size = score_dims.size(); auto& dev_ctx = ctx.template device_context(); diff --git a/paddle/fluid/operators/fused/fusion_repeated_fc_relu_op.cc b/paddle/fluid/operators/fused/fusion_repeated_fc_relu_op.cc index fcbc3237cc0fae8f3bf20794bba9d382f44f8cb4..b42c52cf5cabaf78150e8869c104b25571e4c545 100644 --- a/paddle/fluid/operators/fused/fusion_repeated_fc_relu_op.cc +++ b/paddle/fluid/operators/fused/fusion_repeated_fc_relu_op.cc @@ -153,7 +153,7 @@ class FusionRepeatedFCReluKernel : public framework::OpKernel { auto place = ctx.GetPlace(); int weight_sz = static_cast(weights.size()); - auto i_dims = in->dims(); + auto i_dims = phi::vectorize(in->dims()); const auto& w_dims = weights[0]->dims(); phi::jit::matmul_attr_t attr; attr.m = i_dims[0]; diff --git a/paddle/fluid/pybind/tensor_py.h b/paddle/fluid/pybind/tensor_py.h index 607aa5a894cc3e8fa25e4d04c1e912d031dc1dd6..ea024205faf3935d29ce7daf8b2d9c805d5e6e4d 100644 --- a/paddle/fluid/pybind/tensor_py.h +++ b/paddle/fluid/pybind/tensor_py.h @@ -689,7 +689,7 @@ void _sliceCompute(const phi::DenseTensor *in, const std::vector &axes, const std::vector &starts) { auto &eigen_place = *ctx.eigen_device(); - auto out_dims = out->dims(); + auto out_dims = phi::vectorize(out->dims()); auto in_dims = in->dims(); auto offsets = Eigen::DSizes(); diff --git a/paddle/phi/kernels/cpu/matrix_nms_kernel.cc b/paddle/phi/kernels/cpu/matrix_nms_kernel.cc index 3c51468e7c713ea86e4d5e75e6f7c22c8e5cfa34..942b7fabf6af56f7431e6e7516c753aaadfafe97 100644 --- a/paddle/phi/kernels/cpu/matrix_nms_kernel.cc +++ b/paddle/phi/kernels/cpu/matrix_nms_kernel.cc @@ -255,7 +255,7 @@ void MatrixNMSKernel(const Context& ctx, DenseTensor* out, DenseTensor* index, DenseTensor* roisnum) { - auto score_dims = scores.dims(); + auto score_dims = phi::vectorize(scores.dims()); auto batch_size = score_dims[0]; auto num_boxes = score_dims[2]; auto box_dim = bboxes.dims()[2]; diff --git a/paddle/phi/kernels/cpu/multiclass_nms3_kernel.cc b/paddle/phi/kernels/cpu/multiclass_nms3_kernel.cc index dc82ffbea8791c46190c7d381e5d35507e9f9693..d7772e1c3be621e80129a563315a3b8f45511d16 100644 --- a/paddle/phi/kernels/cpu/multiclass_nms3_kernel.cc +++ b/paddle/phi/kernels/cpu/multiclass_nms3_kernel.cc @@ -496,7 +496,7 @@ void MultiClassNMSKernel(const Context& ctx, DenseTensor* nms_rois_num) { bool return_index = index != nullptr; bool has_roisnum = rois_num.get_ptr() != nullptr; - auto score_dims = scores.dims(); + auto score_dims = phi::vectorize(scores.dims()); auto score_size = score_dims.size(); std::vector>> all_indices; diff --git a/paddle/phi/kernels/sparse/cpu/sparse_utils_kernel.cc b/paddle/phi/kernels/sparse/cpu/sparse_utils_kernel.cc index dcb4399aa28627f894132ed52d24568a5dcd6252..99ccb878e425425368b2653b4caa5d8b6ed7298f 100644 --- a/paddle/phi/kernels/sparse/cpu/sparse_utils_kernel.cc +++ b/paddle/phi/kernels/sparse/cpu/sparse_utils_kernel.cc @@ -258,7 +258,7 @@ void CooToDenseCPUKernel(const CPUContext& dev_ctx, const auto dense_dims = x.dims(); const auto indices = x.indices(); const auto values = x.values(); - const auto indices_dims = indices.dims(); + const auto indices_dims = phi::vectorize(indices.dims()); int64_t sparse_dim = indices_dims[0]; if (indices_dims.size() == 1) { sparse_dim = 1;