Skip to content

Commit

Permalink
fix -Werror=maybe-uninitialized (#51608)
Browse files Browse the repository at this point in the history
  • Loading branch information
engineer1109 authored Mar 14, 2023
1 parent e34c79c commit ae428a0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion paddle/fluid/operators/detection/multiclass_nms_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class MultiClassNMSKernel : public framework::OpKernel<T> {
auto index = ctx.Output<phi::DenseTensor>("Index");
bool has_roisnum = ctx.HasInput("RoisNum") ? true : false;
auto rois_num = ctx.Input<phi::DenseTensor>("RoisNum");
auto score_dims = scores->dims();
auto score_dims = phi::vectorize<int>(scores->dims());
auto score_size = score_dims.size();
auto& dev_ctx = ctx.template device_context<phi::CPUContext>();

Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/fused/fusion_repeated_fc_relu_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class FusionRepeatedFCReluKernel : public framework::OpKernel<T> {
auto place = ctx.GetPlace();
int weight_sz = static_cast<int>(weights.size());

auto i_dims = in->dims();
auto i_dims = phi::vectorize<int>(in->dims());
const auto& w_dims = weights[0]->dims();
phi::jit::matmul_attr_t attr;
attr.m = i_dims[0];
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/pybind/tensor_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ void _sliceCompute(const phi::DenseTensor *in,
const std::vector<int> &axes,
const std::vector<int> &starts) {
auto &eigen_place = *ctx.eigen_device();
auto out_dims = out->dims();
auto out_dims = phi::vectorize<int>(out->dims());
auto in_dims = in->dims();

auto offsets = Eigen::DSizes<Eigen::DenseIndex, D>();
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/matrix_nms_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(scores.dims());
auto batch_size = score_dims[0];
auto num_boxes = score_dims[2];
auto box_dim = bboxes.dims()[2];
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/multiclass_nms3_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(scores.dims());
auto score_size = score_dims.size();

std::vector<std::map<int, std::vector<int>>> all_indices;
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/sparse/cpu/sparse_utils_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(indices.dims());
int64_t sparse_dim = indices_dims[0];
if (indices_dims.size() == 1) {
sparse_dim = 1;
Expand Down

0 comments on commit ae428a0

Please sign in to comment.