Skip to content

Commit

Permalink
Fix recevied received (PaddlePaddle#61128)
Browse files Browse the repository at this point in the history
* Fix

* Fix
  • Loading branch information
co63oc committed Jan 25, 2024
1 parent e5a8ffd commit 581745f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion paddle/fluid/operators/math/sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Sampler {
range,
0,
platform::errors::InvalidArgument(
"Range should be greater than 0, but recevied %d.", range));
"Range should be greater than 0, but received %d.", range));
if (seed == 0) {
std::random_device r;
seed_ = r();
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/optimizers/sgd_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class SGDOpKernel<phi::CPUContext, T> : public framework::OpKernel<T> {
id_index,
static_cast<int64_t>(0),
platform::errors::InvalidArgument(
"The id in SgdOp should be >= 0. But recevied id_index is [%s]",
"The id in SgdOp should be >= 0. But received id_index is [%s]",
id_index));
for (int64_t j = 0; j < grad_row_width; j++) {
out_data[id_index * grad_row_width + j] -=
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/partial_concat_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PartialConcatOp : public framework::OperatorWithKernel {
0,
platform::errors::InvalidArgument(
"ShapeError: Input tensors count should > 0. But "
"recevied inputs' length is 0."));
"received inputs' length is 0."));
if (inputs_num == 1) {
VLOG(3) << "Warning: concat op have only one input, may waste memory";
}
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/operators/partial_sum_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class PartialSumOp : public framework::OperatorWithKernel {
0,
platform::errors::InvalidArgument(
"ShapeError: Input tensors count should > 0. But "
"recevied inputs' length is 0."));
"received inputs' length is 0."));
if (inputs_num == 1) {
VLOG(3) << "Warning: partial_sum op have only one input, may be useless";
}
Expand Down
18 changes: 9 additions & 9 deletions paddle/phi/infermeta/binary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2572,30 +2572,30 @@ void PReluInferMeta(const MetaTensor& x,
1,
phi::errors::InvalidArgument(
"For mode 'all', size of weight Alpha must be one. "
"But recevied alpha's size: %d.",
"But received alpha's size: %d.",
product(alpha.dims())));
} else if (mode == "channel") {
auto x_rank = x_dim.size();
PADDLE_ENFORCE_GE(x_rank,
2,
phi::errors::InvalidArgument(
"For mode 'channel', rank of input X must be "
"equal or larger than 2. But recevied X's "
"equal or larger than 2. But received X's "
"rank: %d",
x_rank));
PADDLE_ENFORCE_EQ(data_format == "NCHW" || data_format == "NHWC",
true,
phi::errors::InvalidArgument(
"For mode 'channel', data_format must be one of "
"NCHW and NHWC. But recevied data_format: %s",
"NCHW and NHWC. But received data_format: %s",
data_format));
if (data_format == "NCHW" || config.is_run_mkldnn_kernel) {
PADDLE_ENFORCE_EQ(product(alpha.dims()) == x_dim[1],
true,
phi::errors::InvalidArgument(
"For mode 'channel', size of weight Alpha must be "
"equal to the number of channels of input(x). But "
"recevied alpha's size: %d, x_dim[1]: %d",
"received alpha's size: %d, x_dim[1]: %d",
product(alpha.dims()),
x_dim[1]));
} else {
Expand All @@ -2604,7 +2604,7 @@ void PReluInferMeta(const MetaTensor& x,
phi::errors::InvalidArgument(
"For mode 'channel', size of weight Alpha must be "
"equal to the number of channels of input(x). But "
"recevied alpha's size: %d, x_dim[%d]: %d",
"received alpha's size: %d, x_dim[%d]: %d",
product(alpha.dims()),
x_rank - 1,
x_dim[x_rank - 1]));
Expand All @@ -2617,15 +2617,15 @@ void PReluInferMeta(const MetaTensor& x,
1,
phi::errors::InvalidArgument(
"For mode 'element', rank of input X must be "
"equal or larger than 1. But recevied X's "
"equal or larger than 1. But received X's "
"rank: %d",
x_rank));
PADDLE_ENFORCE_EQ(
alpha_rank,
x_rank,
phi::errors::InvalidArgument(
"For mode 'element', rank of weight Alpha must be ",
"equal to the rank of input(x). But recevied alpha's rank: %d, "
"equal to the rank of input(x). But received alpha's rank: %d, "
"x's rank: %d.",
alpha_rank,
x_rank));
Expand All @@ -2640,14 +2640,14 @@ void PReluInferMeta(const MetaTensor& x,
x_product,
phi::errors::InvalidArgument(
"For mode 'element', the size of weight Alpha must be "
"equal to the size of input(x). But recevied alpha's size: %d, "
"equal to the size of input(x). But received alpha's size: %d, "
"x's size: %d.",
alpha_product,
x_product));
} else {
PADDLE_THROW(phi::errors::InvalidArgument(
"Attr(mode) of prelu must be one of 'all', 'channel', or 'element'. "
"But recevied "
"But received "
"mode: '%s'.",
mode));
}
Expand Down
10 changes: 5 additions & 5 deletions paddle/phi/infermeta/unary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,7 @@ void MaxOutInferMeta(const MetaTensor& x,
axis == 1 || axis == -1 || axis == 3,
true,
phi::errors::InvalidArgument(
"axis only supported 1, -1 or 3, but recevied axis is: %d.", axis));
"axis only supported 1, -1 or 3, but received axis is: %d.", axis));
PADDLE_ENFORCE_EQ(in_x_dims.size(),
4,
phi::errors::InvalidArgument(
Expand Down Expand Up @@ -2985,7 +2985,7 @@ void PixelUnshuffleInferMeta(const MetaTensor& x,
true,
phi::errors::InvalidArgument(
"data_format must be one of "
"NCHW and NHWC. But recevied data_format: %s",
"NCHW and NHWC. But received data_format: %s",
data_format));

const bool channel_last = (data_format == "NHWC");
Expand Down Expand Up @@ -5012,13 +5012,13 @@ void UniformRandomInplaceInferMeta(const MetaTensor& x,
0,
errors::InvalidArgument(
"The uniform_random's diag_num must greater than or "
"equal 0. But recevied diag_num (%d) < 0.",
"equal 0. But received diag_num (%d) < 0.",
diag_num));
PADDLE_ENFORCE_GE(diag_step,
0,
errors::InvalidArgument(
"The uniform_random's diag_step must greater than or "
"equal 0. But recevied diag_step (%d) < 0.",
"equal 0. But received diag_step (%d) < 0.",
diag_step));
PADDLE_ENFORCE_NE(out,
nullptr,
Expand Down Expand Up @@ -5375,7 +5375,7 @@ void ChannelShuffleInferMeta(const MetaTensor& x,
true,
phi::errors::InvalidArgument(
"data_format must be one of "
"NCHW and NHWC. But recevied data_format: %s",
"NCHW and NHWC. But received data_format: %s",
data_format));

const bool channel_last = (data_format == "NHWC");
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/cpu/sgd_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void SGDSparseParamSparseGradKernel(
id_index,
static_cast<int64_t>(0),
phi::errors::InvalidArgument(
"The id in SgdOp should be >= 0. But recevied id_index is [%s]",
"The id in SgdOp should be >= 0. But received id_index is [%s]",
id_index));
for (int64_t j = 0; j < grad_row_width; j++) {
out_data[id_index * grad_row_width + j] -=
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/jit/dy2static/convert_call_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def attach(self, func):
setattr(func, CONVERSION_OPTIONS, self)
else:
translator_logger.warn(
"Only support @not_to_static to type(function) or type(method), but recevied {}".format(
"Only support @not_to_static to type(function) or type(method), but received {}".format(
type(func)
)
)
Expand Down

0 comments on commit 581745f

Please sign in to comment.