Skip to content

Commit

Permalink
fix_mode_and_bincount_api
Browse files Browse the repository at this point in the history
  • Loading branch information
xingmingyyj committed Mar 25, 2024
1 parent 4ef550f commit 2564443
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions paddle/phi/infermeta/binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,14 @@ void BincountInferMeta(const MetaTensor& x,
}
out->set_dims(common::make_ddim({-1}));
if (weights) {
out->set_dtype(weights.dtype());
if (weights.dtype() == DataType::FLOAT32) {
out->set_dtype(DataType::FLOAT32);
} else {
out->set_dtype(DataType::FLOAT64);
}
} else {
out->set_dtype(x.dtype());
out->set_dtype(DataType::INT64);
}

out->share_lod(x);
}

Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/infermeta/unary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,7 @@ void ModeInferMeta(const MetaTensor& x,

indices->set_dims(dims);
indices->share_lod(x);
indices->set_dtype(x.dtype());
indices->set_dtype(DataType::INT64);
}

void MultinomialInferMeta(const MetaTensor& x,
Expand Down

0 comments on commit 2564443

Please sign in to comment.