From 805328e13b564674e0183ed76f34224a0c6ea78e Mon Sep 17 00:00:00 2001 From: zhangchunle Date: Thu, 16 Jan 2020 15:56:12 +0800 Subject: [PATCH] fix typo in error message (#22312) --- paddle/fluid/operators/array_to_lod_tensor_op.cc | 4 ++-- paddle/fluid/operators/beam_search_decode_op.cc | 8 ++++---- paddle/fluid/operators/controlflow/compare_op.cc | 4 ++-- paddle/fluid/operators/distributed_ops/merge_ids_op.cc | 8 ++++---- paddle/fluid/operators/distributed_ops/split_ids_op.cc | 4 ++-- .../operators/get_tensor_from_selected_rows_op.cc | 4 ++-- paddle/fluid/operators/lod_rank_table_op.cc | 2 +- paddle/fluid/operators/merge_lod_tensor_op.cc | 10 +++++----- paddle/fluid/operators/split_lod_tensor_op.cc | 8 ++++---- paddle/fluid/operators/split_selected_rows_op.cc | 5 +++-- python/paddle/fluid/backward.py | 2 +- python/paddle/fluid/evaluator.py | 2 +- 12 files changed, 31 insertions(+), 30 deletions(-) diff --git a/paddle/fluid/operators/array_to_lod_tensor_op.cc b/paddle/fluid/operators/array_to_lod_tensor_op.cc index ea65cf4e62..4f656ab165 100644 --- a/paddle/fluid/operators/array_to_lod_tensor_op.cc +++ b/paddle/fluid/operators/array_to_lod_tensor_op.cc @@ -189,9 +189,9 @@ class ArrayToLoDTensorInferShape : public framework::InferShapeBase { public: void operator()(framework::InferShapeContext *context) const override { PADDLE_ENFORCE(context->HasInput("X"), - "ArrayToLoDTensorOp must has input X."); + "ArrayToLoDTensorOp must have input X."); 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 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 diff --git a/paddle/fluid/operators/beam_search_decode_op.cc b/paddle/fluid/operators/beam_search_decode_op.cc index 5eec87887a..3edaf58cd0 100644 --- a/paddle/fluid/operators/beam_search_decode_op.cc +++ b/paddle/fluid/operators/beam_search_decode_op.cc @@ -191,13 +191,13 @@ class BeamSearchDecodeInferShape : public framework::InferShapeBase { public: void operator()(framework::InferShapeContext* context) const override { PADDLE_ENFORCE(context->HasInput("Ids"), - "BeamSearchDecodeOp must has input Ids"); + "BeamSearchDecodeOp must have input Ids"); PADDLE_ENFORCE(context->HasInput("Scores"), - "BeamSearchDecodeOp must has input Scores"); + "BeamSearchDecodeOp must have input Scores"); PADDLE_ENFORCE(context->HasOutput("SentenceIds"), - "BeamSearchDecodeOp must has output SentenceIds"); + "BeamSearchDecodeOp must have output SentenceIds"); PADDLE_ENFORCE(context->HasOutput("SentenceScores"), - "BeamSearchDecodeOp must has output SentenceScores"); + "BeamSearchDecodeOp must have output SentenceScores"); } }; diff --git a/paddle/fluid/operators/controlflow/compare_op.cc b/paddle/fluid/operators/controlflow/compare_op.cc index be71319cbb..11b24304ea 100644 --- a/paddle/fluid/operators/controlflow/compare_op.cc +++ b/paddle/fluid/operators/controlflow/compare_op.cc @@ -80,9 +80,9 @@ class CompareOp : public framework::OperatorWithKernel { protected: void InferShape(framework::InferShapeContext* context) const override { 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); - PADDLE_ENFORCE(context->HasInput("Y"), "%s operator must has input Y", + PADDLE_ENFORCE(context->HasInput("Y"), "%s operator must have input Y", comment.type); auto dim_x = context->GetInputDim("X"); auto dim_y = context->GetInputDim("Y"); diff --git a/paddle/fluid/operators/distributed_ops/merge_ids_op.cc b/paddle/fluid/operators/distributed_ops/merge_ids_op.cc index 712ff56c8c..324edd7e47 100644 --- a/paddle/fluid/operators/distributed_ops/merge_ids_op.cc +++ b/paddle/fluid/operators/distributed_ops/merge_ids_op.cc @@ -83,12 +83,12 @@ class MergeIdsOp : public framework::OperatorWithKernel { void InferShape(framework::InferShapeContext *ctx) const override { PADDLE_ENFORCE(ctx->HasInputs("Ids"), - "MergeIdsOp must has multi input Ids."); + "MergeIdsOp must have multi input Ids."); PADDLE_ENFORCE(ctx->HasInputs("Rows"), - "MergeIdsOp must has multi input Rows."); - PADDLE_ENFORCE(ctx->HasInputs("X"), "MergeIdsOp must has multi input X."); + "MergeIdsOp must have multi input Rows."); + PADDLE_ENFORCE(ctx->HasInputs("X"), "MergeIdsOp must have multi input X."); 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_dims = ctx->GetInputsDim("Ids"); diff --git a/paddle/fluid/operators/distributed_ops/split_ids_op.cc b/paddle/fluid/operators/distributed_ops/split_ids_op.cc index 603f697592..b708626760 100644 --- a/paddle/fluid/operators/distributed_ops/split_ids_op.cc +++ b/paddle/fluid/operators/distributed_ops/split_ids_op.cc @@ -52,8 +52,8 @@ class SplitIdsOp : public framework::OperatorWithKernel { using framework::OperatorWithKernel::OperatorWithKernel; void InferShape(framework::InferShapeContext *ctx) const override { - PADDLE_ENFORCE(ctx->HasInputs("Ids"), "SplitIdsOp must has input Ids."); - PADDLE_ENFORCE(ctx->HasOutputs("Out"), "SplitIdsOp must has output Out."); + PADDLE_ENFORCE(ctx->HasInputs("Ids"), "SplitIdsOp must have input Ids."); + PADDLE_ENFORCE(ctx->HasOutputs("Out"), "SplitIdsOp must have output Out."); auto ids_var_type = ctx->GetInputsVarType("Ids").front(); auto ids_dims = ctx->GetInputsDim("Ids"); diff --git a/paddle/fluid/operators/get_tensor_from_selected_rows_op.cc b/paddle/fluid/operators/get_tensor_from_selected_rows_op.cc index d8470bad11..8c90965678 100644 --- a/paddle/fluid/operators/get_tensor_from_selected_rows_op.cc +++ b/paddle/fluid/operators/get_tensor_from_selected_rows_op.cc @@ -24,9 +24,9 @@ class GetTensorFromSelectedRowsOp : public framework::OperatorWithKernel { void InferShape(framework::InferShapeContext *ctx) const override { PADDLE_ENFORCE(ctx->HasInput("X"), - "GetTensorFromSelectedRowsOp must has input X."); + "GetTensorFromSelectedRowsOp must have input X."); PADDLE_ENFORCE(ctx->HasOutput("Out"), - "GetTensorFromSelectedRowsOp must has output Out."); + "GetTensorFromSelectedRowsOp must have output Out."); PADDLE_ENFORCE( ctx->GetInputsVarType("X").front() == framework::proto::VarType::SELECTED_ROWS, diff --git a/paddle/fluid/operators/lod_rank_table_op.cc b/paddle/fluid/operators/lod_rank_table_op.cc index 8e16834e84..c73aaf75bc 100644 --- a/paddle/fluid/operators/lod_rank_table_op.cc +++ b/paddle/fluid/operators/lod_rank_table_op.cc @@ -58,7 +58,7 @@ output operators. class LoDRankTableInferShape : public framework::InferShapeBase { public: 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"); } }; diff --git a/paddle/fluid/operators/merge_lod_tensor_op.cc b/paddle/fluid/operators/merge_lod_tensor_op.cc index e832aca3c6..e5465db716 100644 --- a/paddle/fluid/operators/merge_lod_tensor_op.cc +++ b/paddle/fluid/operators/merge_lod_tensor_op.cc @@ -179,15 +179,15 @@ class MergeLoDTensorInferShape : public framework::InferShapeBase { public: void operator()(framework::InferShapeContext *context) const override { PADDLE_ENFORCE(context->HasInput("X"), - "MergeLoDTensorOp must has input X."); + "MergeLoDTensorOp must have input X."); PADDLE_ENFORCE(context->HasInput("Mask"), - "MergeLoDTensorOp must has input Mask."); + "MergeLoDTensorOp must have input Mask."); PADDLE_ENFORCE(context->HasInput("InTrue"), - "MergeLoDTensorOp must has input InTrue."); + "MergeLoDTensorOp must have input InTrue."); PADDLE_ENFORCE(context->HasInput("InFalse"), - "MergeLoDTensorOp must has input InFalse."); + "MergeLoDTensorOp must have input InFalse."); PADDLE_ENFORCE(context->HasOutput("Out"), - "MergeLoDTensorOp must has output Out"); + "MergeLoDTensorOp must have output Out"); auto mask_dim = context->GetInputDim("Mask"); PADDLE_ENFORCE_EQ(mask_dim.size(), 2, diff --git a/paddle/fluid/operators/split_lod_tensor_op.cc b/paddle/fluid/operators/split_lod_tensor_op.cc index fedd8543ae..94916a9659 100644 --- a/paddle/fluid/operators/split_lod_tensor_op.cc +++ b/paddle/fluid/operators/split_lod_tensor_op.cc @@ -147,13 +147,13 @@ class SplitLoDTensorInferShape : public framework::InferShapeBase { public: void operator()(framework::InferShapeContext *context) const override { PADDLE_ENFORCE(context->HasInput("X"), - "SplitLoDTensorOp must has input X."); + "SplitLoDTensorOp must have input X."); PADDLE_ENFORCE(context->HasInput("Mask"), - "SplitLoDTensorOp must has input Mask."); + "SplitLoDTensorOp must have input Mask."); PADDLE_ENFORCE(context->HasOutput("OutTrue"), - "SplitLoDTensorOp must has output OutTrue."); + "SplitLoDTensorOp must have output OutTrue."); PADDLE_ENFORCE(context->HasOutput("OutFalse"), - "SplitLoDTensorOp must has output OutFalse."); + "SplitLoDTensorOp must have output OutFalse."); auto mask_dim = context->GetInputDim("Mask"); PADDLE_ENFORCE_EQ(mask_dim.size(), 2, diff --git a/paddle/fluid/operators/split_selected_rows_op.cc b/paddle/fluid/operators/split_selected_rows_op.cc index b0217d93e9..7a3202617f 100644 --- a/paddle/fluid/operators/split_selected_rows_op.cc +++ b/paddle/fluid/operators/split_selected_rows_op.cc @@ -54,9 +54,10 @@ class SplitSelectedRowsOp : public framework::OperatorWithKernel { using framework::OperatorWithKernel::OperatorWithKernel; 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"), - "SplitSelectedRowsOp must has output Out."); + "SplitSelectedRowsOp must have output Out."); } }; diff --git a/python/paddle/fluid/backward.py b/python/paddle/fluid/backward.py index 317c495643..fc58d2e1c7 100644 --- a/python/paddle/fluid/backward.py +++ b/python/paddle/fluid/backward.py @@ -1057,7 +1057,7 @@ def append_backward(loss, be invoked once each time a new gradient operator is added into the program. The callable - object must has two input + object must have two input parameters: 'block' and 'context'. The 'block' is the :ref:`api_guide_Block_en` which the new gradient operator will diff --git a/python/paddle/fluid/evaluator.py b/python/paddle/fluid/evaluator.py index 80ac91575f..5c8386af3a 100644 --- a/python/paddle/fluid/evaluator.py +++ b/python/paddle/fluid/evaluator.py @@ -224,7 +224,7 @@ class EditDistance(Evaluator): Args: 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. ignored_tokens(list of int): Tokens that should be removed before calculating edit distance. -- GitLab