提交 805328e1 编写于 作者: Z zhangchunle 提交者: Tao Luo

fix typo in error message (#22312)

上级 b339dff2
...@@ -189,9 +189,9 @@ class ArrayToLoDTensorInferShape : public framework::InferShapeBase { ...@@ -189,9 +189,9 @@ class ArrayToLoDTensorInferShape : public framework::InferShapeBase {
public: public:
void operator()(framework::InferShapeContext *context) const override { void operator()(framework::InferShapeContext *context) const override {
PADDLE_ENFORCE(context->HasInput("X"), PADDLE_ENFORCE(context->HasInput("X"),
"ArrayToLoDTensorOp must has input X."); "ArrayToLoDTensorOp must have input X.");
PADDLE_ENFORCE(context->HasInput("RankTable"), PADDLE_ENFORCE(context->HasInput("RankTable"),
"ArrayToLoDTensorOp must has input RankTable."); "ArrayToLoDTensorOp must have input RankTable.");
// For compile-time, the first dim of input X and output Out should be -1. // For compile-time, the first dim of input X and output Out should be -1.
// For runtime, the first dim of output Out should be the sum of all // For runtime, the first dim of output Out should be the sum of all
// elements's first dim in input X. The output's dims will be re-computed in // elements's first dim in input X. The output's dims will be re-computed in
......
...@@ -191,13 +191,13 @@ class BeamSearchDecodeInferShape : public framework::InferShapeBase { ...@@ -191,13 +191,13 @@ class BeamSearchDecodeInferShape : public framework::InferShapeBase {
public: public:
void operator()(framework::InferShapeContext* context) const override { void operator()(framework::InferShapeContext* context) const override {
PADDLE_ENFORCE(context->HasInput("Ids"), PADDLE_ENFORCE(context->HasInput("Ids"),
"BeamSearchDecodeOp must has input Ids"); "BeamSearchDecodeOp must have input Ids");
PADDLE_ENFORCE(context->HasInput("Scores"), PADDLE_ENFORCE(context->HasInput("Scores"),
"BeamSearchDecodeOp must has input Scores"); "BeamSearchDecodeOp must have input Scores");
PADDLE_ENFORCE(context->HasOutput("SentenceIds"), PADDLE_ENFORCE(context->HasOutput("SentenceIds"),
"BeamSearchDecodeOp must has output SentenceIds"); "BeamSearchDecodeOp must have output SentenceIds");
PADDLE_ENFORCE(context->HasOutput("SentenceScores"), PADDLE_ENFORCE(context->HasOutput("SentenceScores"),
"BeamSearchDecodeOp must has output SentenceScores"); "BeamSearchDecodeOp must have output SentenceScores");
} }
}; };
......
...@@ -80,9 +80,9 @@ class CompareOp : public framework::OperatorWithKernel { ...@@ -80,9 +80,9 @@ class CompareOp : public framework::OperatorWithKernel {
protected: protected:
void InferShape(framework::InferShapeContext* context) const override { void InferShape(framework::InferShapeContext* context) const override {
OpComment comment; OpComment comment;
PADDLE_ENFORCE(context->HasInput("X"), "%s operator must has input X", PADDLE_ENFORCE(context->HasInput("X"), "%s operator must have input X",
comment.type); comment.type);
PADDLE_ENFORCE(context->HasInput("Y"), "%s operator must has input Y", PADDLE_ENFORCE(context->HasInput("Y"), "%s operator must have input Y",
comment.type); comment.type);
auto dim_x = context->GetInputDim("X"); auto dim_x = context->GetInputDim("X");
auto dim_y = context->GetInputDim("Y"); auto dim_y = context->GetInputDim("Y");
......
...@@ -83,12 +83,12 @@ class MergeIdsOp : public framework::OperatorWithKernel { ...@@ -83,12 +83,12 @@ class MergeIdsOp : public framework::OperatorWithKernel {
void InferShape(framework::InferShapeContext *ctx) const override { void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE(ctx->HasInputs("Ids"), PADDLE_ENFORCE(ctx->HasInputs("Ids"),
"MergeIdsOp must has multi input Ids."); "MergeIdsOp must have multi input Ids.");
PADDLE_ENFORCE(ctx->HasInputs("Rows"), PADDLE_ENFORCE(ctx->HasInputs("Rows"),
"MergeIdsOp must has multi input Rows."); "MergeIdsOp must have multi input Rows.");
PADDLE_ENFORCE(ctx->HasInputs("X"), "MergeIdsOp must has multi input X."); PADDLE_ENFORCE(ctx->HasInputs("X"), "MergeIdsOp must have multi input X.");
PADDLE_ENFORCE(ctx->HasOutputs("Out"), PADDLE_ENFORCE(ctx->HasOutputs("Out"),
"MergeIdsOp must has multi output Out."); "MergeIdsOp must have multi output Out.");
auto ids_var_type = ctx->GetInputsVarType("Ids").front(); auto ids_var_type = ctx->GetInputsVarType("Ids").front();
auto ids_dims = ctx->GetInputsDim("Ids"); auto ids_dims = ctx->GetInputsDim("Ids");
......
...@@ -52,8 +52,8 @@ class SplitIdsOp : public framework::OperatorWithKernel { ...@@ -52,8 +52,8 @@ class SplitIdsOp : public framework::OperatorWithKernel {
using framework::OperatorWithKernel::OperatorWithKernel; using framework::OperatorWithKernel::OperatorWithKernel;
void InferShape(framework::InferShapeContext *ctx) const override { void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE(ctx->HasInputs("Ids"), "SplitIdsOp must has input Ids."); PADDLE_ENFORCE(ctx->HasInputs("Ids"), "SplitIdsOp must have input Ids.");
PADDLE_ENFORCE(ctx->HasOutputs("Out"), "SplitIdsOp must has output Out."); PADDLE_ENFORCE(ctx->HasOutputs("Out"), "SplitIdsOp must have output Out.");
auto ids_var_type = ctx->GetInputsVarType("Ids").front(); auto ids_var_type = ctx->GetInputsVarType("Ids").front();
auto ids_dims = ctx->GetInputsDim("Ids"); auto ids_dims = ctx->GetInputsDim("Ids");
......
...@@ -24,9 +24,9 @@ class GetTensorFromSelectedRowsOp : public framework::OperatorWithKernel { ...@@ -24,9 +24,9 @@ class GetTensorFromSelectedRowsOp : public framework::OperatorWithKernel {
void InferShape(framework::InferShapeContext *ctx) const override { void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE(ctx->HasInput("X"), PADDLE_ENFORCE(ctx->HasInput("X"),
"GetTensorFromSelectedRowsOp must has input X."); "GetTensorFromSelectedRowsOp must have input X.");
PADDLE_ENFORCE(ctx->HasOutput("Out"), PADDLE_ENFORCE(ctx->HasOutput("Out"),
"GetTensorFromSelectedRowsOp must has output Out."); "GetTensorFromSelectedRowsOp must have output Out.");
PADDLE_ENFORCE( PADDLE_ENFORCE(
ctx->GetInputsVarType("X").front() == ctx->GetInputsVarType("X").front() ==
framework::proto::VarType::SELECTED_ROWS, framework::proto::VarType::SELECTED_ROWS,
......
...@@ -58,7 +58,7 @@ output operators. ...@@ -58,7 +58,7 @@ output operators.
class LoDRankTableInferShape : public framework::InferShapeBase { class LoDRankTableInferShape : public framework::InferShapeBase {
public: public:
void operator()(framework::InferShapeContext *context) const override { void operator()(framework::InferShapeContext *context) const override {
PADDLE_ENFORCE(context->HasInput("X"), "LoDRankTable must has input X"); PADDLE_ENFORCE(context->HasInput("X"), "LoDRankTable must have input X");
} }
}; };
......
...@@ -179,15 +179,15 @@ class MergeLoDTensorInferShape : public framework::InferShapeBase { ...@@ -179,15 +179,15 @@ class MergeLoDTensorInferShape : public framework::InferShapeBase {
public: public:
void operator()(framework::InferShapeContext *context) const override { void operator()(framework::InferShapeContext *context) const override {
PADDLE_ENFORCE(context->HasInput("X"), PADDLE_ENFORCE(context->HasInput("X"),
"MergeLoDTensorOp must has input X."); "MergeLoDTensorOp must have input X.");
PADDLE_ENFORCE(context->HasInput("Mask"), PADDLE_ENFORCE(context->HasInput("Mask"),
"MergeLoDTensorOp must has input Mask."); "MergeLoDTensorOp must have input Mask.");
PADDLE_ENFORCE(context->HasInput("InTrue"), PADDLE_ENFORCE(context->HasInput("InTrue"),
"MergeLoDTensorOp must has input InTrue."); "MergeLoDTensorOp must have input InTrue.");
PADDLE_ENFORCE(context->HasInput("InFalse"), PADDLE_ENFORCE(context->HasInput("InFalse"),
"MergeLoDTensorOp must has input InFalse."); "MergeLoDTensorOp must have input InFalse.");
PADDLE_ENFORCE(context->HasOutput("Out"), PADDLE_ENFORCE(context->HasOutput("Out"),
"MergeLoDTensorOp must has output Out"); "MergeLoDTensorOp must have output Out");
auto mask_dim = context->GetInputDim("Mask"); auto mask_dim = context->GetInputDim("Mask");
PADDLE_ENFORCE_EQ(mask_dim.size(), 2, PADDLE_ENFORCE_EQ(mask_dim.size(), 2,
......
...@@ -147,13 +147,13 @@ class SplitLoDTensorInferShape : public framework::InferShapeBase { ...@@ -147,13 +147,13 @@ class SplitLoDTensorInferShape : public framework::InferShapeBase {
public: public:
void operator()(framework::InferShapeContext *context) const override { void operator()(framework::InferShapeContext *context) const override {
PADDLE_ENFORCE(context->HasInput("X"), PADDLE_ENFORCE(context->HasInput("X"),
"SplitLoDTensorOp must has input X."); "SplitLoDTensorOp must have input X.");
PADDLE_ENFORCE(context->HasInput("Mask"), PADDLE_ENFORCE(context->HasInput("Mask"),
"SplitLoDTensorOp must has input Mask."); "SplitLoDTensorOp must have input Mask.");
PADDLE_ENFORCE(context->HasOutput("OutTrue"), PADDLE_ENFORCE(context->HasOutput("OutTrue"),
"SplitLoDTensorOp must has output OutTrue."); "SplitLoDTensorOp must have output OutTrue.");
PADDLE_ENFORCE(context->HasOutput("OutFalse"), PADDLE_ENFORCE(context->HasOutput("OutFalse"),
"SplitLoDTensorOp must has output OutFalse."); "SplitLoDTensorOp must have output OutFalse.");
auto mask_dim = context->GetInputDim("Mask"); auto mask_dim = context->GetInputDim("Mask");
PADDLE_ENFORCE_EQ(mask_dim.size(), 2, PADDLE_ENFORCE_EQ(mask_dim.size(), 2,
......
...@@ -54,9 +54,10 @@ class SplitSelectedRowsOp : public framework::OperatorWithKernel { ...@@ -54,9 +54,10 @@ class SplitSelectedRowsOp : public framework::OperatorWithKernel {
using framework::OperatorWithKernel::OperatorWithKernel; using framework::OperatorWithKernel::OperatorWithKernel;
void InferShape(framework::InferShapeContext *ctx) const override { void InferShape(framework::InferShapeContext *ctx) const override {
PADDLE_ENFORCE(ctx->HasInput("X"), "SplitSelectedRowsOp must has input X."); PADDLE_ENFORCE(ctx->HasInput("X"),
"SplitSelectedRowsOp must have input X.");
PADDLE_ENFORCE(ctx->HasOutputs("Out"), PADDLE_ENFORCE(ctx->HasOutputs("Out"),
"SplitSelectedRowsOp must has output Out."); "SplitSelectedRowsOp must have output Out.");
} }
}; };
......
...@@ -1057,7 +1057,7 @@ def append_backward(loss, ...@@ -1057,7 +1057,7 @@ def append_backward(loss,
be invoked once each time a be invoked once each time a
new gradient operator is added new gradient operator is added
into the program. The callable into the program. The callable
object must has two input object must have two input
parameters: 'block' and 'context'. parameters: 'block' and 'context'.
The 'block' is the :ref:`api_guide_Block_en` which The 'block' is the :ref:`api_guide_Block_en` which
the new gradient operator will the new gradient operator will
......
...@@ -224,7 +224,7 @@ class EditDistance(Evaluator): ...@@ -224,7 +224,7 @@ class EditDistance(Evaluator):
Args: Args:
input: the sequences predicted by network. input: the sequences predicted by network.
label: the target sequences which must has same sequence count label: the target sequences which must have same sequence count
with input. with input.
ignored_tokens(list of int): Tokens that should be removed before ignored_tokens(list of int): Tokens that should be removed before
calculating edit distance. calculating edit distance.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册