diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc index 41f043268ddc1d..dcbd70f51bb0c8 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/multiary_infer_sym.cc @@ -1754,9 +1754,9 @@ bool FusedAttentionOpInferSymbolicShape( PADDLE_ENFORCE_EQ(qkv_weight_shape.size(), 2, common::errors::InvalidArgument( - "The dimensions of qkv_weight must be 2 if enable" - "transpose_qkv_wb: (dim_embed, 3 * dim_embed)," - "but received dimensions of" + "The dimensions of qkv_weight must be 2 if enable " + "transpose_qkv_wb: (dim_embed, 3 * dim_embed), " + "but received dimensions of " "Input is [%d]", qkv_weight_shape.size())); PADDLE_ENFORCE_GT(num_heads_, @@ -1779,7 +1779,7 @@ bool FusedAttentionOpInferSymbolicShape( PADDLE_ENFORCE_EQ(qkv_weight_shape.size(), 4, common::errors::InvalidArgument( - "The dimensions of qkv_weight must be 4 if not" + "The dimensions of qkv_weight must be 4 if not " "enable transpose_qkv_wb: (3, num_head, dim_head, " "dim_embed), but received [%d]", qkv_weight_shape.size())); @@ -2227,16 +2227,16 @@ bool FusedMultiTransformerOpInferSymbolicShape( x_shape.size(), 3, common::errors::InvalidArgument("The dimensions of x must be 3" - "(batch_size, seq_len, dim_embed)," - "but received dimensions of" + "(batch_size, seq_len, dim_embed), " + "but received dimensions of " "Input is [%d]", x_shape.size())); PADDLE_ENFORCE_EQ( y_shape.size(), 4, common::errors::InvalidArgument("The dimensions of qkv_weight must be 4" - "(3, num_head, dim_head, dim_embed)," - "but received dimensions of" + "(3, num_head, dim_head, dim_embed), " + "but received dimensions of " "Input is [%d]", y_shape.size())); @@ -3086,19 +3086,19 @@ bool MemoryEfficientAttentionOpInferSymbolicShape( PADDLE_ENFORCE_EQ( q_shape.size(), 4, - common::errors::InvalidArgument("Query should be a 4-D tensor" + common::errors::InvalidArgument("Query should be a 4-D tensor. " "But received Query dimension(%d)", q_shape.size())); PADDLE_ENFORCE_EQ( k_shape.size(), 4, - common::errors::InvalidArgument("Key should be a 4-D tensor" + common::errors::InvalidArgument("Key should be a 4-D tensor. " "But received Key dimension(%d)", k_shape.size())); PADDLE_ENFORCE_EQ( v_shape.size(), 4, - common::errors::InvalidArgument("Value should be a 4-D tensor" + common::errors::InvalidArgument("Value should be a 4-D tensor. " "But received Value dimension(%d)", v_shape.size())); @@ -4808,12 +4808,12 @@ bool YoloLossOpInferSymbolicShape( if (op->operand_source(3) != nullptr) { const auto &score_shape = infer_context->GetShapeOrDataForValue(op->operand_source(3)).shape(); - PADDLE_ENFORCE_EQ( - score_shape.size(), - 2, - common::errors::InvalidArgument("Input(GTScore) should be a 2-D tensor" - "But received GTScore dimension(%s)", - box_shape.size())); + PADDLE_ENFORCE_EQ(score_shape.size(), + 2, + common::errors::InvalidArgument( + "Input(GTScore) should be a 2-D tensor. " + "But received GTScore dimension(%s)", + box_shape.size())); infer_context->AddEqualCstr(score_shape[0], box_shape[0]); infer_context->AddEqualCstr(score_shape[1], box_shape[1]); } diff --git a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc index fca5f88da5e266..6750759633d0b8 100644 --- a/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc +++ b/paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/unary_infer_sym.cc @@ -1459,7 +1459,7 @@ bool FlattenOpInferSymbolicShape( PADDLE_ENFORCE_GE( stop_axis, start_axis, - common::errors::InvalidArgument("The stop_axis should be greater" + common::errors::InvalidArgument("The stop_axis should be greater " "than or equal to start_axis.")); } @@ -2035,7 +2035,7 @@ bool MaxPool2dWithIndexOpInferSymbolicShape( PADDLE_ENFORCE_EQ( x_shape.size(), 4, - common::errors::InvalidArgument("Pooling input should be 4-D Tensor" + common::errors::InvalidArgument("Pooling input should be 4-D Tensor, " "but received %dD-Tensor", x_shape.size())); @@ -2069,7 +2069,7 @@ bool MaxPool3dWithIndexOpInferSymbolicShape( PADDLE_ENFORCE_EQ( x_shape.size(), 5, - common::errors::InvalidArgument("Pooling input should be 5-D Tensor" + common::errors::InvalidArgument("Pooling input should be 5-D Tensor, " "but received %dD-Tensor", x_shape.size())); diff --git a/paddle/fluid/pir/dialect/operator/ir/manual_op.cc b/paddle/fluid/pir/dialect/operator/ir/manual_op.cc index c3200afd583379..483c91085e6a90 100644 --- a/paddle/fluid/pir/dialect/operator/ir/manual_op.cc +++ b/paddle/fluid/pir/dialect/operator/ir/manual_op.cc @@ -1000,7 +1000,7 @@ void FusedGemmEpilogueGradOp::Build(pir::Builder &builder, PADDLE_ENFORCE( attributes.find("activation_grad") != attributes.end(), - common::errors::NotFound("'activation_grad' Attribute is expected for" + common::errors::NotFound("'activation_grad' Attribute is expected for " "FusedGemmEpilogueGradOp")); std::string activation_grad = attributes.at("activation_grad").dyn_cast().AsString(); @@ -1071,7 +1071,7 @@ std::vector FusedGemmEpilogueGradOp::InferMeta( PADDLE_ENFORCE( attributes.find("activation_grad") != attributes.end(), - common::errors::NotFound("'activation_grad' Attribute is expected for" + common::errors::NotFound("'activation_grad' Attribute is expected for " "FusedGemmEpilogueGradOp")); std::string activation_grad = attributes.at("activation_grad").dyn_cast().AsString(); diff --git a/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc b/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc index e53b1d4626a696..ef3511f2072b35 100644 --- a/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc +++ b/paddle/fluid/pir/transforms/pd_op_to_kernel_pass.cc @@ -2851,9 +2851,9 @@ std::vector BuildInputs( PADDLE_THROW(common::errors::Unimplemented( "builtin.combine Input type only support " "VectorType and " - "VectorType and" - "VectorType and" - "VectorType and" + "VectorType and " + "VectorType and " + "VectorType and " "VectorType")); } @@ -2912,9 +2912,9 @@ std::vector BuildInputs( PADDLE_THROW(common::errors::Unimplemented( "builtin.combine Input type only support " "VectorType and " - "VectorType and" - "VectorType and" - "VectorType and" + "VectorType and " + "VectorType and " + "VectorType and " "VectorType")); } in_i = AddPlaceTransferOp( diff --git a/paddle/fluid/pir/transforms/tensorrt/trt_op_marker_pass.cc b/paddle/fluid/pir/transforms/tensorrt/trt_op_marker_pass.cc index cf6d0fd09b250a..72ee552e169aaa 100644 --- a/paddle/fluid/pir/transforms/tensorrt/trt_op_marker_pass.cc +++ b/paddle/fluid/pir/transforms/tensorrt/trt_op_marker_pass.cc @@ -1768,7 +1768,7 @@ class BilinearInterpV2Pattern if (scale.size() <= 1) { if (!op->HasAttribute("out_h") || !op->HasAttribute("out_w")) { VLOG(3) << "BilinearInterpV2 doesn't have scale_tensor and the scale " - "size <=1 and without" + "size <=1 and without " "out_h / out_w, it will return false"; return false; } @@ -2895,7 +2895,7 @@ class LinearInterpOpPattern if (!op->HasAttribute("out_w")) { VLOG(3) << "pd_op.linear_interp doesn't have scale_tensor and the scale " - "size <=1 and without" + "size <=1 and without " "out_w, it will return false"; return false; } diff --git a/paddle/phi/infermeta/backward.cc b/paddle/phi/infermeta/backward.cc index 08c1fe582500ad..78850b24cf6b6c 100644 --- a/paddle/phi/infermeta/backward.cc +++ b/paddle/phi/infermeta/backward.cc @@ -1157,13 +1157,13 @@ void MemoryEfficientAttentionGradInferMeta(const MetaTensor& query, PADDLE_ENFORCE_EQ( output_grad.dims().size(), 4, - common::errors::InvalidArgument("Key should be a 4-D tensor" + common::errors::InvalidArgument("Key should be a 4-D tensor. " "But received Key dimension(%s)", output_grad.dims().size())); PADDLE_ENFORCE_EQ( output.dims().size(), 4, - common::errors::InvalidArgument("Key should be a 4-D tensor" + common::errors::InvalidArgument("Key should be a 4-D tensor. " "But received Key dimension(%s)", output_grad.dims().size())); @@ -1254,13 +1254,13 @@ void MoeCombineGradInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ( x_dim.size(), 2, - errors::InvalidArgument("The input X should have 2 dimensions" + errors::InvalidArgument("The input X should have 2 dimensions. " "But received X's dimension = %d", x_dim.size())); PADDLE_ENFORCE_EQ( (scatter_index.dtype() == phi::DataType::INT32), true, - errors::InvalidArgument("The input scatter_index type should be int32" + errors::InvalidArgument("The input scatter_index type should be int32. " "But received scatter_index type = %s", scatter_index.dtype())); grad_x->set_dims(common::make_ddim({x_dim[0], x_dim[1]})); diff --git a/paddle/phi/infermeta/binary.cc b/paddle/phi/infermeta/binary.cc index c6a1ab135f2a7d..581725aabc6835 100644 --- a/paddle/phi/infermeta/binary.cc +++ b/paddle/phi/infermeta/binary.cc @@ -1095,8 +1095,7 @@ void CrossEntropyInferMeta(const MetaTensor& x, "shall have the same dimensions. But received: the dimensions of " "Input(X) is [%d]," "the shape of Input(X) is [%s], the dimensions of Input(Label) " - "is " - "[%d], the shape of" + "is [%d], the shape of " "Input(Label) is [%s]", rank, x_dims, @@ -1109,11 +1108,11 @@ void CrossEntropyInferMeta(const MetaTensor& x, label_dims[rank - 1], common::errors::InvalidArgument( "If Attr(soft_label) == true, the last dimension of " - "Input(X) and Input(Label) should be equal. But received: the" + "Input(X) and Input(Label) should be equal. But received: the " "last dimension of Input(X) is [%d], the shape of Input(X) is " - "[%s]," + "[%s], " "the last dimension of Input(Label) is [%d], the shape of " - "Input(Label)" + "Input(Label) " "is [%s], the last dimension is [%d].", x_dims[rank - 1], x_dims, @@ -2707,9 +2706,9 @@ void LogLossInferMeta(const MetaTensor& input, pred_dims, label_dims, common::errors::InvalidArgument( - "The dimensions of Input(Predicted) must be equal to the" + "The dimensions of Input(Predicted) must be equal to the " "dimensions of Input(Labels), but received dimensions of " - "Input(Predicted)" + "Input(Predicted) " "is [%s], received dimensions of Input(Labels) is [%s].", pred_dims, label_dims)); @@ -3332,7 +3331,7 @@ void MvInferMeta(const MetaTensor& x, const MetaTensor& vec, MetaTensor* out) { dim_vec[0], common::errors::InvalidArgument( "X's second dimension is expected to be equal to " - "Vec's first dimension" + "Vec's first dimension, " "but received X'shape = [%s], Vec's shape = [%s]", dim_x, dim_vec)); @@ -4535,9 +4534,9 @@ void UnpoolInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ(in_x_dims, in_y_dims, common::errors::InvalidArgument( - "The dimensions of Input(X) must equal to be" - "the dimensions of Input(Indices), but received" - "dimensions of Input(X) is [%d], received dimensions" + "The dimensions of Input(X) must equal to be " + "the dimensions of Input(Indices), but received " + "dimensions of Input(X) is [%d], received dimensions " "of Input(Indices) is [%d]", in_x_dims, in_y_dims)); @@ -4581,9 +4580,9 @@ void Unpool3dInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ(in_x_dims, in_y_dims, common::errors::InvalidArgument( - "The dimensions of Input(X) must equal to be" - "the dimensions of Input(Indices), but received" - "dimensions of Input(X) is [%d], received dimensions" + "The dimensions of Input(X) must equal to be " + "the dimensions of Input(Indices), but received " + "dimensions of Input(X) is [%d], received dimensions " "of Input(Indices) is [%d]", in_x_dims, in_y_dims)); @@ -4656,7 +4655,7 @@ void WeightDequantizeInferMeta(const MetaTensor& x, (x.dims()[1] + (group_size - 1)) / group_size, errors::InvalidArgument("The input(weight_scale) dim[0] must be equal " "to (Input(weight).dim[1] + (group_size -1))" - " / group_size" + " / group_size. " "But receive %d and %d", dim_scale[0], (x.dims()[1] + (group_size - 1)) / group_size)); diff --git a/paddle/phi/infermeta/fusion.cc b/paddle/phi/infermeta/fusion.cc index f4a16df2ca0930..0152ddcebc90bf 100644 --- a/paddle/phi/infermeta/fusion.cc +++ b/paddle/phi/infermeta/fusion.cc @@ -187,8 +187,8 @@ void FusedMultiTransformerInferMeta( x_dim.size(), 3, common::errors::InvalidArgument("The dimensions of x must be 3" - "(batch_size, seq_len, dim_embed)," - "but received dimensions of" + "(batch_size, seq_len, dim_embed), " + "but received dimensions of " "Input is [%d]", x_dim.size())); @@ -197,8 +197,8 @@ void FusedMultiTransformerInferMeta( 3, common::errors::InvalidArgument( "The dimensions of qkv_weight when use gqa must be 3" - "(num_head + 2 * kv_num_heads, dim_head, dim_embed)," - "but received dimensions of" + "(num_head + 2 * kv_num_heads, dim_head, dim_embed), " + "but received dimensions of " "Input is [%d]", y_dim.size())); } else { @@ -206,8 +206,8 @@ void FusedMultiTransformerInferMeta( y_dim.size(), 4, common::errors::InvalidArgument("The dimensions of qkv_weight must be 4" - "(3, num_head, dim_head, dim_embed)," - "but received dimensions of" + "(3, num_head, dim_head, dim_embed), " + "but received dimensions of " "Input is [%d]", y_dim.size())); } @@ -264,7 +264,7 @@ void FusedMultiTransformerInferMeta( PADDLE_ENFORCE_EQ(c_dim[2], gqa_group_size, common::errors::InvalidArgument( - "The third dim of CacheKV must be equal with num" + "The third dim of CacheKV must be equal with num " "head %d, but got %d", gqa_group_size, c_dim[2])); // num_head @@ -280,7 +280,7 @@ void FusedMultiTransformerInferMeta( PADDLE_ENFORCE_EQ(c_dim[2], trans_qkvw ? y_dim[1] : y_dim[2], common::errors::InvalidArgument( - "The third dim of CacheKV must be equal with num" + "The third dim of CacheKV must be equal with num " "head %d, but got %d", trans_qkvw ? y_dim[1] : y_dim[2], c_dim[2])); // num_head @@ -956,9 +956,9 @@ void FusedAttentionInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ(y_dim.size(), 2, common::errors::InvalidArgument( - "The dimensions of qkv_weight must be 2 if enable" - "transpose_qkv_wb: (dim_embed, 3 * dim_embed)," - "but received dimensions of" + "The dimensions of qkv_weight must be 2 if enable " + "transpose_qkv_wb: (dim_embed, 3 * dim_embed), " + "but received dimensions of " "Input is [%d]", y_dim.size())); PADDLE_ENFORCE_GT(num_heads, @@ -991,7 +991,7 @@ void FusedAttentionInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ(y_dim.size(), 4, common::errors::InvalidArgument( - "The dimensions of qkv_weight must be 4 if not" + "The dimensions of qkv_weight must be 4 if not " "enable transpose_qkv_wb: (3, num_head, dim_head, " "dim_embed), but received [%d]", y_dim.size())); @@ -1019,8 +1019,8 @@ void FusedAttentionInferMeta(const MetaTensor& x, x_dim.size(), 3, common::errors::InvalidArgument("The dimensions of x must be 3" - "(batch_size, seq_len, dim_embed)," - "but received dimensions of" + "(batch_size, seq_len, dim_embed), " + "but received dimensions of " "Input is [%d]", x_dim.size())); @@ -1423,8 +1423,8 @@ void FusedDotProductAttentionInferMeta(const MetaTensor& q, PADDLE_ENFORCE(q_dim.size() == 4 && k_dim.size() == 4 && v_dim.size() == 4, common::errors::InvalidArgument( "The dimensions of q, k, v must be 4" - "(batch_size, seq_len, num_heads, head_size)," - "but received dimensions of" + "(batch_size, seq_len, num_heads, head_size), " + "but received dimensions of " "Input is [%d], [%d], [%d]", q_dim.size(), k_dim.size(), @@ -1432,8 +1432,8 @@ void FusedDotProductAttentionInferMeta(const MetaTensor& q, PADDLE_ENFORCE(q_dim[0] == k_dim[0] && k_dim[0] == v_dim[0], common::errors::InvalidArgument( - "The first dimension of q, k, v must be equal" - "but received dimensions of" + "The first dimension of q, k, v must be equal, " + "but received dimensions of " "Input is [%d], [%d], [%d]", q_dim[0], k_dim[0], @@ -1662,7 +1662,7 @@ void FusedElemwiseAddActivationInferMeta( true, common::errors::InvalidArgument( "When the FusedElemwiseAddActivationOp Is used in fused pass, the " - "elementwise_add Op must be" + "elementwise_add Op must be " "detected and used, Please check the fuse pass pattern")); } @@ -1746,7 +1746,7 @@ void FusedElemwiseAddActivationGradInferMeta( true, common::errors::InvalidArgument( "When the FusedElemwiseAddActivationOpGrad Is used in fused pass, " - "the elementwise_add_grad Op must be" + "the elementwise_add_grad Op must be " "detected and used, Please check the fuse pass pattern")); } @@ -2028,7 +2028,7 @@ void FusedGemmEpilogueGradInferMeta(const MetaTensor& x, dout_mat_dims[1], trans_y ? y_dims[0] : y_dims[1], common::errors::InvalidArgument( - "The last dimension of DOut should be equal with Y's last" + "The last dimension of DOut should be equal with Y's last " "dimension. But received DOut[-1] = [%d], Y[1] = [%d].", dout_mat_dims[1], y_dims[1])); @@ -2328,16 +2328,16 @@ void FusedMultiTransformerInt8InferMeta( x_dim.size(), 3, common::errors::InvalidArgument("The dimensions of x must be 3" - "(batch_size, seq_len, dim_embed)," - "but received dimensions of" + "(batch_size, seq_len, dim_embed), " + "but received dimensions of " "Input is [%d]", x_dim.size())); PADDLE_ENFORCE_EQ( y_dim.size(), 4, common::errors::InvalidArgument("The dimensions of qkv_weight must be 4" - "(3, num_head, dim_head, dim_embed)," - "but received dimensions of" + "(3, num_head, dim_head, dim_embed), " + "but received dimensions of " "Input is [%d]", y_dim.size())); PADDLE_ENFORCE_EQ( @@ -3905,7 +3905,7 @@ void FusionGRUInferMeta(const MetaTensor& x, wx_dims[0], x_mat_dims[1], common::errors::InvalidArgument( - "The first dimension of flattened WeightX" + "The first dimension of flattened WeightX " "should equal to last dimension of flattened input X, but " "received fattened WeightX dimension is:%d, flattened X dimension " "is:%d", @@ -4444,19 +4444,19 @@ void VariableLengthMemoryEfficientAttentionInferMeta( PADDLE_ENFORCE_EQ( query.dims().size(), 4, - common::errors::InvalidArgument("Query should be a 4-D tensor" + common::errors::InvalidArgument("Query should be a 4-D tensor. " "But received Query dimension(%s)", query.dims().size())); PADDLE_ENFORCE_EQ( key.dims().size(), 4, - common::errors::InvalidArgument("Key should be a 4-D tensor" + common::errors::InvalidArgument("Key should be a 4-D tensor. " "But received Key dimension(%s)", key.dims().size())); PADDLE_ENFORCE_EQ( value.dims().size(), 4, - common::errors::InvalidArgument("Value should be a 4-D tensor" + common::errors::InvalidArgument("Value should be a 4-D tensor. " "But received Value dimension(%s)", value.dims().size())); @@ -4512,7 +4512,7 @@ void VariableLengthMemoryEfficientAttentionInferMeta( PADDLE_ENFORCE_EQ( mask.dims().size(), 4, - common::errors::InvalidArgument("Mask should be a 4-D tensor" + common::errors::InvalidArgument("Mask should be a 4-D tensor. " "But received Value dimension(%s)", mask.dims().size())); const int64_t mask_batch_size = mask.dims()[0]; @@ -4822,7 +4822,7 @@ void MultiGruInferMeta( weight_x[i]->dims()[0], x_mat_dims[1], common::errors::InvalidArgument( - "The first dimension of flattened WeightX #%d" + "The first dimension of flattened WeightX #%d " "should equal to last dimension of flattened input X, but " "received fattened WeightX dimension is:%d, flattened X " "dimension " @@ -5353,39 +5353,39 @@ void FusedTokenPruneInferMeta(const MetaTensor& attn, PADDLE_ENFORCE_EQ(mask_dim[0], attn_dim[0], common::errors::InvalidArgument( - "The first dim of mask and attn should be the same" + "The first dim of mask and attn should be the same " "which is batch size")); PADDLE_ENFORCE_EQ(mask_dim[1], attn_dim[1], common::errors::InvalidArgument( - "The second dim of mask and attn should be the same" + "The second dim of mask and attn should be the same " "which is nb_head")); PADDLE_ENFORCE_EQ(mask_dim[0], x_dim[0], common::errors::InvalidArgument( - "The first dim of mask and x should be the same" + "The first dim of mask and x should be the same " "which is batch size")); PADDLE_ENFORCE_EQ( mask_dim[2], mask_dim[3], common::errors::InvalidArgument( - "The third dim and the fourth dim of mask should be the same" + "The third dim and the fourth dim of mask should be the same " "which is max seq len")); PADDLE_ENFORCE_EQ( attn_dim[2], attn_dim[3], common::errors::InvalidArgument( - "The third dim and the fourth dim of mask should be the same" + "The third dim and the fourth dim of mask should be the same " "which is max seq len")); PADDLE_ENFORCE_EQ(attn_dim[2], mask_dim[2], common::errors::InvalidArgument( - "The third dim of mask and attn should be the same" + "The third dim of mask and attn should be the same " "which is max seq len")); PADDLE_ENFORCE_EQ(attn_dim[2], x_dim[1], common::errors::InvalidArgument( - "The third dim of mask and the second dim of attn" + "The third dim of mask and the second dim of attn " "should be the same which is max seq len")); auto bsz = mask_dim[0]; diff --git a/paddle/phi/infermeta/multiary.cc b/paddle/phi/infermeta/multiary.cc index eaddd75c097c7d..3e1edcddd48d92 100644 --- a/paddle/phi/infermeta/multiary.cc +++ b/paddle/phi/infermeta/multiary.cc @@ -1348,7 +1348,7 @@ void ConcatInferMeta(const std::vector& x, PADDLE_ENFORCE_GE(x.size(), 0UL, common::errors::InvalidArgument( - "The size of input meta vector should be greater" + "The size of input meta vector should be greater " "than 0.")); if (axis_scalar.FromTensor() && !config.is_runtime) { auto out_dims = @@ -2652,15 +2652,16 @@ void FusedLayerNormInferMeta(const MetaTensor& x, } if (config.is_runtime) { if (norm_weight) { - PADDLE_ENFORCE_EQ(normalized_dims, - norm_weight.dims()[0], - common::errors::InvalidArgument( - "The normalized size of Input(X) must equal to be" - "the size of Weight, but received" - "normalized size of Input(X) is [%d], received size" - "of Weight is [%d]", - normalized_dims, - norm_weight.dims()[0])); + PADDLE_ENFORCE_EQ( + normalized_dims, + norm_weight.dims()[0], + common::errors::InvalidArgument( + "The normalized size of Input(X) must equal to be " + "the size of Weight, but received " + "normalized size of Input(X) is [%d], received size " + "of Weight is [%d]", + normalized_dims, + norm_weight.dims()[0])); } } @@ -3243,7 +3244,7 @@ static void Interpolate1DInferShapeCheck( PADDLE_ENFORCE_EQ("linear", interp_method, common::errors::InvalidArgument( - "Interpolation method can only be \"linear\" when" + "Interpolation method can only be \"linear\" when " "Input(X) dimension is 3, but got method = %s .", interp_method)); const DataLayout data_layout = common::StringToDataLayout(data_layout_str); @@ -4147,19 +4148,19 @@ void MemoryEfficientAttentionInferMeta(const MetaTensor& query, PADDLE_ENFORCE_EQ( query.dims().size(), 4, - common::errors::InvalidArgument("Query should be a 4-D tensor" + common::errors::InvalidArgument("Query should be a 4-D tensor. " "But received Query dimension(%s)", query.dims().size())); PADDLE_ENFORCE_EQ( key.dims().size(), 4, - common::errors::InvalidArgument("Key should be a 4-D tensor" + common::errors::InvalidArgument("Key should be a 4-D tensor. " "But received Key dimension(%s)", key.dims().size())); PADDLE_ENFORCE_EQ( value.dims().size(), 4, - common::errors::InvalidArgument("Value should be a 4-D tensor" + common::errors::InvalidArgument("Value should be a 4-D tensor. " "But received Value dimension(%s)", value.dims().size())); @@ -5573,7 +5574,7 @@ void UnchangedMultiInferMeta(const std::vector& x, x.size(), out.size(), common::errors::InvalidArgument( - "Input's size should be equal to the output's size" + "Input's size should be equal to the output's size, " "but received input size: (%d) does not equals output_size: (%d)", x.size(), out.size())); @@ -5793,7 +5794,7 @@ void WeightOnlyLinearInferMeta(const MetaTensor& x, weight_scale_dims[0], (w_dims[1] + (group_size - 1)) / group_size, errors::InvalidArgument("The input(weight_scale) dim[0] must be equal " - "to Input(weight) dim[1] / group_size" + "to Input(weight) dim[1] / group_size. " "But receive %d and %d", weight_scale_dims[0], (w_dims[1] + (group_size - 1)) / group_size)); @@ -6000,17 +6001,17 @@ void YoloLossInferMeta(const MetaTensor& x, if (gt_score) { auto dim_gtscore = gt_score.dims(); - PADDLE_ENFORCE_EQ( - dim_gtscore.size(), - 2, - common::errors::InvalidArgument("Input(GTScore) should be a 2-D tensor" - "But received GTScore dimension(%s)", - dim_gtbox.size())); + PADDLE_ENFORCE_EQ(dim_gtscore.size(), + 2, + common::errors::InvalidArgument( + "Input(GTScore) should be a 2-D tensor. " + "But received GTScore dimension(%s)", + dim_gtbox.size())); PADDLE_ENFORCE_EQ( dim_gtscore[0], dim_gtbox[0], common::errors::InvalidArgument( - "Input(GTBox) and Input(GTScore) dim[0] should be same" + "Input(GTBox) and Input(GTScore) dim[0] should be same. " "But received GTBox dim[0](%s) != GTScore dim[0](%s)", dim_gtbox[0], dim_gtscore[0])); @@ -6018,7 +6019,7 @@ void YoloLossInferMeta(const MetaTensor& x, dim_gtscore[1], dim_gtbox[1], common::errors::InvalidArgument( - "Input(GTBox) and Input(GTScore) dim[1] should be same" + "Input(GTBox) and Input(GTScore) dim[1] should be same. " "But received GTBox dim[1](%s) != GTScore dim[1](%s)", dim_gtscore[1], dim_gtbox[1])); diff --git a/paddle/phi/infermeta/ternary.cc b/paddle/phi/infermeta/ternary.cc index b7ca2257970295..7625ded6824a5f 100644 --- a/paddle/phi/infermeta/ternary.cc +++ b/paddle/phi/infermeta/ternary.cc @@ -372,7 +372,7 @@ void BoxCoderInferMeta(const MetaTensor& prior_box, prior_box_dims, prior_box_var_dims, common::errors::InvalidArgument( - "The dimension of Input(PriorBoxVar) should be equal to" + "The dimension of Input(PriorBoxVar) should be equal to " "the dimension of Input(PriorBox) in BoxCoder operator " "when the rank is 2.")); } @@ -1272,7 +1272,7 @@ void LayerNormInferMeta(const MetaTensor& x, PADDLE_ENFORCE_GT(begin_norm_axis, 0, common::errors::InvalidArgument( - "'begin_norm_axis' in Op(LayerNorm) should be" + "'begin_norm_axis' in Op(LayerNorm) should be " "greater than zero. But received [%d].", begin_norm_axis)); PADDLE_ENFORCE_LT( @@ -1296,7 +1296,7 @@ void LayerNormInferMeta(const MetaTensor& x, 1, common::errors::InvalidArgument( "The dimensions of Input(Scale) must be 1, but " - "received dimensions of" + "received dimensions of " "Input(Scale) is [%d]", scale.dims().size())); } @@ -1306,10 +1306,10 @@ void LayerNormInferMeta(const MetaTensor& x, scale.dims()[0], right, common::errors::InvalidArgument( - "The first dimension value of Input(Scale) must equal to be the" - "second dimension value of the flattened 2D matrix of Input(X)," - "But received the first dimension value of Input(Scale) is" - "[%d], the second dimension value of the flattened 2D matrix of" + "The first dimension value of Input(Scale) must equal to be the " + "second dimension value of the flattened 2D matrix of Input(X), " + "But received the first dimension value of Input(Scale) is " + "[%d], the second dimension value of the flattened 2D matrix of " " Input(Scale) is [%d].", scale.dims()[0], right)); @@ -1319,7 +1319,7 @@ void LayerNormInferMeta(const MetaTensor& x, 1, common::errors::InvalidArgument( "The dimensions of Input(Bias) must be 1, but " - "received dimensions of" + "received dimensions of " "Input(Bias) is [%d]", bias.dims().size())); } @@ -1328,10 +1328,10 @@ void LayerNormInferMeta(const MetaTensor& x, bias.dims()[0], right, common::errors::InvalidArgument( - "The first dimension value of Input(Bias) must equal to be the" - "second dimension value of the flattened 2D matrix of Input(X)," - "But received the first dimension value of Input(Bias) is" - "[%d], the second dimension value of the flattened 2D matrix of" + "The first dimension value of Input(Bias) must equal to be the " + "second dimension value of the flattened 2D matrix of Input(X), " + "But received the first dimension value of Input(Bias) is " + "[%d], the second dimension value of the flattened 2D matrix of " " Input(Bias) is [%d].", bias.dims()[0], right)); @@ -1627,7 +1627,7 @@ void MoeCombineInferMeta(const MetaTensor& x, 2, common::errors::InvalidArgument( "The dimensions of Input(x) must be 1, but " - "received dimensions of" + "received dimensions of " "Input(x) is [%d]", x_dim.size())); // maybe there is more conditions here.... @@ -1696,7 +1696,7 @@ void MoeGateDispatchPartialNoSoftmaxTopKInferMeta( 2, common::errors::InvalidArgument( "The dimensions of Input(x) must be 2, but " - "received dimensions of" + "received dimensions of " "Input(x) is [%d]", x_dims.size())); auto combine_weights_dims = combine_weights.dims(); @@ -1705,7 +1705,7 @@ void MoeGateDispatchPartialNoSoftmaxTopKInferMeta( 2, common::errors::InvalidArgument( "The dimensions of Input(combine_weights) must be 2, but " - "received dimensions of" + "received dimensions of " "Input(combine_weights) is [%d]", combine_weights_dims.size())); PADDLE_ENFORCE_EQ(combine_weights_dims[0], @@ -1804,7 +1804,7 @@ void MoeGateDispatchPermuteInferMeta(const MetaTensor& x, 2, common::errors::InvalidArgument( "The dimensions of Input(x) must be 2, but " - "received dimensions of" + "received dimensions of " "Input(x) is [%d]", x_dims.size())); auto gate_logits_dims = gate_logits.dims(); @@ -1812,7 +1812,7 @@ void MoeGateDispatchPermuteInferMeta(const MetaTensor& x, 2, common::errors::InvalidArgument( "The dimensions of Input(gate_logits) must be 2, but " - "received dimensions of" + "received dimensions of " "Input(gate_logits) is [%d]", gate_logits_dims.size())); PADDLE_ENFORCE_EQ(gate_logits_dims[0], @@ -2199,7 +2199,7 @@ void RoiAlignInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ(input_dims.size(), 4, common::errors::InvalidArgument( - "The format of Input(x) in" + "The format of Input(x) in " "RoiAlignOp is NCHW. And the rank of input must be 4. " "But received rank = %d", input_dims.size())); diff --git a/paddle/phi/infermeta/unary.cc b/paddle/phi/infermeta/unary.cc index 89135880485c18..a30e9fd2f035e4 100644 --- a/paddle/phi/infermeta/unary.cc +++ b/paddle/phi/infermeta/unary.cc @@ -1162,8 +1162,8 @@ void EighInferMeta(const MetaTensor& x, input_dim[rank - 2], input_dim[rank - 1], common::errors::InvalidArgument( - "Eigh op is designed for square matrix, consequently" - "inner-most 2 dimensions of Input(X) should be symmetric." + "Eigh op is designed for square matrix, consequently " + "inner-most 2 dimensions of Input(X) should be symmetric. " "But received X's shape[-2] = %d and shape[-1] = %d.", input_dim[rank - 2], input_dim[rank - 1])); @@ -1230,8 +1230,8 @@ void EigvalshInferMeta(const MetaTensor& x, input_dim[rank - 2], input_dim[rank - 1], errors::InvalidArgument( - "Eigvalsh op is designed for square matrix, consequently" - "inner-most 2 dimensions of Input(X) should be symmetric." + "Eigvalsh op is designed for square matrix, consequently " + "inner-most 2 dimensions of Input(X) should be symmetric. " "But received X's shape[-2] = %d and shape[-1] = %d.", input_dim[rank - 2], input_dim[rank - 1])); @@ -1395,7 +1395,7 @@ void ExpandModalityExpertIdInferMeta(const MetaTensor& expert_id, expert_id.dtype() == DataType::INT64, true, common::errors::InvalidArgument( - "The dtype of expert_id should be INT32 or INT64. But received" + "The dtype of expert_id should be INT32 or INT64. But received " "dtype=%s.", DataTypeToString(expert_id.dtype()))); @@ -1652,7 +1652,7 @@ void FlattenInferMeta(const MetaTensor& x, PADDLE_ENFORCE_GE( stop_axis, start_axis, - common::errors::InvalidArgument("The stop_axis should be greater" + common::errors::InvalidArgument("The stop_axis should be greater " "than or equal to start_axis.")); } @@ -1985,7 +1985,7 @@ void FoldInferMeta(const MetaTensor& x, in_dims[1] % (kernel_sizes[0] * kernel_sizes[1]), 0, common::errors::InvalidArgument( - "Expected size of input's dimension 1 to be divisible by the" + "Expected size of input's dimension 1 to be divisible by the " "product of kernel_size, but got input.size(1)=%d and " "kernel_size=( %d" ", %d).", @@ -6063,7 +6063,7 @@ void UniqueConsecutiveInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ(axis.empty(), true, common::errors::InvalidArgument( - "The Input(X) with 0-D Tensor, axis must be None" + "The Input(X) with 0-D Tensor, axis must be None. " "But now the axis is %d.", axis[0])); } @@ -6164,7 +6164,7 @@ void UniqueRawInferMeta(const MetaTensor& x, PADDLE_ENFORCE_EQ(axis.empty(), true, common::errors::InvalidArgument( - "The Input(X) with 0-D Tensor, axis must be None" + "The Input(X) with 0-D Tensor, axis must be None. " "But now the axis is %d.", axis[0])); }