Skip to content

Commit

Permalink
Fix some typos (reviced, paramterless_type, etc.) (PaddlePaddle#61778)
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc committed Feb 22, 2024
1 parent 0d204ec commit dd0bb29
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions paddle/fluid/operators/match_matrix_tensor_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ void MatchMatrixTensorOP::InferShape(framework::InferShapeContext* ctx) const {
x_desc->GetLoDLevel(),
1,
platform::errors::InvalidArgument("The LoD level of Input(X) should be "
"greater than 1, but reviced %d.",
"greater than 1, but received %d.",
x_desc->GetLoDLevel()));
framework::VarDesc* y_desc =
PADDLE_GET(framework::VarDesc*, ctx->GetInputVarPtrs("Y")[0]);
PADDLE_ENFORCE_GE(
y_desc->GetLoDLevel(),
1,
platform::errors::InvalidArgument("The LoD level of Input(Y) should be "
"greater than 1, but reviced %d.",
"greater than 1, but received %d.",
y_desc->GetLoDLevel()));
ctx->ShareLoD("X", "Out");
}
Expand Down
4 changes: 2 additions & 2 deletions test/cpp/new_executor/standalone_executor_pir_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ TEST(StandaloneExecutor, while_op) {
std::vector<int64_t>{1}, 10, phi::DataType::INT32)
.out();

// comput condition value: i <= ten
// compute condition value: i <= ten
auto cond_value = builder.Build<LessEqualOp>(i, ten).out();

auto while_op =
Expand All @@ -312,7 +312,7 @@ TEST(StandaloneExecutor, while_op) {
.out();
auto new_i = builder.Build<AddOp>(body_i_argument, one).out();

// comput new condition value: new_i <= new_ten
// compute new condition value: new_i <= new_ten
auto new_cond_value =
builder.Build<LessEqualOp>(new_i, body_ten_argument).out();

Expand Down
6 changes: 3 additions & 3 deletions test/cpp/pir/control_flow_dialect/while_op_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TEST(while_op_test, base) {
builder.Build<FullOp>(std::vector<int64_t>{1}, 10, phi::DataType::INT32)
.out();

// comput condition value: i < ten
// compute condition value: i < ten
auto cond_value = builder.Build<LessThanOp>(i, ten).out();

auto while_op =
Expand All @@ -69,7 +69,7 @@ TEST(while_op_test, base) {
.out();
auto new_i = builder.Build<AddOp>(body_i_argument, one).out();

// comput new condition value: new_i < new_ten
// compute new condition value: new_i < new_ten
auto new_cond_value =
builder.Build<LessThanOp>(new_i, body_ten_argument).out();

Expand Down Expand Up @@ -124,7 +124,7 @@ TEST(while_op_test, network_with_backward) {
auto new_i = builder.Build<AddOp>(body_i_argument, one).out();
auto new_x = builder.Build<AddOp>(body_x_argument, y).out();

// comput new condition value: new_i < new_ten
// compute new condition value: new_i < new_ten
auto new_cond_value = builder.Build<LessThanOp>(new_i, ten).out();

builder.Build<pir::TuplePushOp>(
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/pir/core/ir_type_converter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void test_parameterless_type_helper() {
(test_parameterless_type<IR_TYPE>(), 0)...};
}

TEST(TypeConverterTest, paramterless_type) {
TEST(TypeConverterTest, parameterless_type) {
test_parameterless_type_helper<pir::UInt8Type,
pir::Int8Type,
pir::BFloat16Type,
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/pir/core/type_interface_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "test/cpp/pir/tools/test_dialect.h"
#include "test/cpp/pir/tools/test_op.h"

TEST(shapedtype_test, shapedtype_test) {
TEST(shape_dtype_test, shape_dtype_test) {
pir::IrContext *ctx = pir::IrContext::Instance();
pir::Dialect *test_dialect = ctx->GetOrRegisterDialect<test::TestDialect>();
ctx->GetOrRegisterDialect<paddle::dialect::OperatorDialect>();
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/pir/pattern_rewrite/drr_same_type_binding_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/ | \ \ \
/ | \ \ \
full / | | \ \ full_tmp
/ | transpos1 | trans2 trans3 \ / |
/ | transpose1 | trans2 trans3 \ / |
/ | / | | | | \ / |
softmax1 | / | | | | \ / |
\ | / softmax2 | | | add1 |
Expand Down
4 changes: 2 additions & 2 deletions test/cpp/pir/sub_graph/sub_graph_checker_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ std::shared_ptr<::pir::Program> BuildDropOutPhiProgram() {
return program;
}

TEST(sub_grah_checker, test_softmax) {
TEST(sub_graph_checker, test_softmax) {
auto basic_program = BuildBasicProgram();
auto prim_program = BuildPrimProgram();

Expand All @@ -156,7 +156,7 @@ TEST(sub_grah_checker, test_softmax) {
ASSERT_EQ(speed_data.size(), 2u);
}

TEST(sub_grah_checker, test_dropout) {
TEST(sub_graph_checker, test_dropout) {
auto basic_program = BuildDropOutPhiProgram();
auto prim_program = BuildDropOutPrimProgram();

Expand Down
6 changes: 3 additions & 3 deletions test/cpp/pir/tools/test_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ class InferShapeInterface : public pir::OpInterfaceBase<InferShapeInterface> {
template <class ConcreteOp>
struct Model : public Concept {
static void InferShape(pir::Operation *op) {
ConcreteOp concret_op = ConcreteOp(op);
if (concret_op == nullptr) throw("concret_op is nullptr");
concret_op.InferShape();
ConcreteOp concrete_op = ConcreteOp(op);
if (concrete_op == nullptr) throw("concrete_op is nullptr");
concrete_op.InferShape();
}

Model() : Concept(InferShape) {}
Expand Down
18 changes: 9 additions & 9 deletions test/cpp/prim/test_static_prim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ TEST(StaticPrim, TanhBackwardComposite) {
static_cast<std::size_t>(1));
}

TEST(StaticCompositeGradMaker, TestMutiInputMethod) {
TEST(StaticCompositeGradMaker, TestMultiInputMethod) {
// Initialized environment
FLAGS_tensor_operants_mode = "static";
paddle::OperantsManager::Instance().static_operants.reset(
Expand Down Expand Up @@ -266,22 +266,22 @@ TEST(StaticCompositeGradMaker, TestMutiInputMethod) {
target_block,
grad_sub_block);
test();
std::vector<paddle::Tensor> muti_fw_input = test.GetMultiForwardInput("X");
paddle::optional<std::vector<paddle::Tensor>> opt_muti_fw_input =
std::vector<paddle::Tensor> multi_fw_input = test.GetMultiForwardInput("X");
paddle::optional<std::vector<paddle::Tensor>> opt_multi_fw_input =
test.GetOptionalMultiForwardInput("X");
std::vector<paddle::Tensor> opt_inner = opt_muti_fw_input.is_initialized()
? opt_muti_fw_input.get()
std::vector<paddle::Tensor> opt_inner = opt_multi_fw_input.is_initialized()
? opt_multi_fw_input.get()
: std::vector<paddle::Tensor>{};
paddle::Tensor fw_out = test.GetSingleForwardOutput("Out");
paddle::Tensor* fw_out_ptr = test.GetOutputPtr(&fw_out);
std::string fw_out_name = test.GetOutputName(fw_out);

ASSERT_EQ(muti_fw_input.size(), static_cast<std::size_t>(2));
ASSERT_EQ(multi_fw_input.size(), static_cast<std::size_t>(2));
ASSERT_EQ(
static_cast<prim::DescTensor*>(muti_fw_input[0].impl().get())->Name(),
static_cast<prim::DescTensor*>(multi_fw_input[0].impl().get())->Name(),
"x0");
ASSERT_EQ(
static_cast<prim::DescTensor*>(muti_fw_input[1].impl().get())->Name(),
static_cast<prim::DescTensor*>(multi_fw_input[1].impl().get())->Name(),
"x1");
ASSERT_EQ(opt_inner.size(), static_cast<std::size_t>(2));
ASSERT_EQ(static_cast<prim::DescTensor*>(opt_inner[0].impl().get())->Name(),
Expand All @@ -292,7 +292,7 @@ TEST(StaticCompositeGradMaker, TestMutiInputMethod) {
ASSERT_EQ(fw_out_name, "out");
}

TEST(StaticCompositeGradMaker, TestMutiOutputMethod) {
TEST(StaticCompositeGradMaker, TestMultiOutputMethod) {
// Initialized environment
FLAGS_tensor_operants_mode = "static";
paddle::OperantsManager::Instance().static_operants.reset(
Expand Down
4 changes: 2 additions & 2 deletions test/custom_op/custom_concat_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ std::vector<paddle::Tensor> ConcatBackwardDynamicAxis(
CHECK_INPUT(axis_t);
CHECK_INPUT(grad_out);

// compate axis
// compute axis
int64_t rank = static_cast<int64_t>(inputs[0].shape().size());
int64_t axis = axis_t.data<int64_t>()[0];
axis = ComputeAxis(axis, rank);
Expand Down Expand Up @@ -182,7 +182,7 @@ std::vector<paddle::Tensor> ConcatBackwardStaticAxis(
}
CHECK_INPUT(grad_out);

// compate axis
// compute axis
int64_t rank = static_cast<int64_t>(inputs[0].shape().size());
auto final_axis = ComputeAxis(axis, rank);

Expand Down
4 changes: 2 additions & 2 deletions test/custom_op/custom_linear_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ std::vector<std::vector<int64_t>> LinearInferShape(
auto ndims_y = weight_shape.size();
PD_CHECK(ndims_x > 0,
"The Input(x) dims size must be greater than 0,"
" but reviced dims size is 0. ");
" but received dims size is 0. ");
PD_CHECK(ndims_y > 0,
"The Input(y) dims size must be greater than 0,"
" but reviced dims size is 0. ");
" but received dims size is 0. ");

bool x_broadcasted = false, y_broadcasted = false;
if (ndims_x == 1) {
Expand Down
4 changes: 2 additions & 2 deletions test/custom_op/dispatch_test_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void assign_cpu_kernel(const data_t* x_data,
}
}

std::vector<paddle::Tensor> DispatchTestInterger(const paddle::Tensor& x) {
std::vector<paddle::Tensor> DispatchTestInteger(const paddle::Tensor& x) {
auto out = paddle::empty_like(x);

PD_DISPATCH_INTEGRAL_TYPES(
Expand All @@ -41,7 +41,7 @@ std::vector<paddle::Tensor> DispatchTestInterger(const paddle::Tensor& x) {
PD_BUILD_OP(dispatch_test_integer)
.Inputs({"X"})
.Outputs({"Out"})
.SetKernelFn(PD_KERNEL(DispatchTestInterger));
.SetKernelFn(PD_KERNEL(DispatchTestInteger));

std::vector<paddle::Tensor> DispatchTestFloatAndInteger(
const paddle::Tensor& x) {
Expand Down

0 comments on commit dd0bb29

Please sign in to comment.