Skip to content

Commit 02b3495

Browse files
authored
fix bug in bit_count and moe_gate_permute. (#73539)
1 parent 81fc54e commit 02b3495

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

paddle/phi/infermeta/ternary.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,16 +1817,6 @@ void MoeGateDispatchPermuteInferMeta(const MetaTensor& x,
18171817
"The dimensions of Input(corr_bias) must be 1, but received "
18181818
"dimensions of Input(corr_bias) is [%d]",
18191819
corr_bias_dims.size()));
1820-
PADDLE_ENFORCE_EQ(
1821-
corr_bias_dims[0],
1822-
x_dims[0],
1823-
common::errors::InvalidArgument(
1824-
"The dimensions of Input(corr_bias) must be equal to the first "
1825-
"dimension of Input(x), but received Input(corr_bias) first "
1826-
"dimension is [%d],"
1827-
"Input(x) first dimension is [%d]",
1828-
corr_bias_dims[0],
1829-
x_dims[0]));
18301820
PADDLE_ENFORCE_EQ(
18311821
corr_bias.dtype(),
18321822
paddle::DataType::FLOAT32,

paddle/phi/infermeta/unary.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6487,17 +6487,11 @@ void IntBincountInferMeta(const MetaTensor& x,
64876487
int64_t high,
64886488
int64_t dtype,
64896489
MetaTensor* out) {
6490-
PADDLE_ENFORCE_EQ(
6491-
x.dims().size(),
6492-
1,
6493-
errors::InvalidArgument(
6494-
"The input 'x' of int_bincount must be a 1-D Tensor, but got %u-D.",
6495-
x.dims().size()));
64966490
PADDLE_ENFORCE_GT(
64976491
high,
64986492
low,
64996493
errors::InvalidArgument("Attr high (%d) must be > low (%d).", high, low));
6500-
int64_t bin_count = high - low + 1;
6494+
int64_t bin_count = high - low;
65016495

65026496
out->set_dims(phi::make_ddim({bin_count}));
65036497
out->set_dtype(x.dtype());

0 commit comments

Comments
 (0)