Skip to content

Commit

Permalink
Fix some typos (SimplifyNegtive, fill_costant, etc.) (#61919)
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc authored Feb 22, 2024
1 parent a720370 commit 763b9fd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion paddle/cinn/common/cas_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ TEST(CAS, SimplifyCompoundMod) {
#endif
}
}
TEST(CAS, SimplifyNegtive) {
TEST(CAS, SimplifyNegative) {
{ // (-1*x) /2
Var x = ir::_Var_::Make("x", Int(32));
auto p0 = ir::FracOp::Make(-x, Expr(2));
Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/frontend/pass/fill_constant_folding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class FillConstantFoldingPass : public ProgramPass {
if (!fill_constant_map.count(key)) {
VLOG(4) << "The fill_constant, whose output is Var ["
<< instr->outputs[0]->id
<< "], cannot remove because it is the first fill_costant ! ";
<< "], cannot remove because it is the first fill_constant ! ";
// retain the first fill constant op node
fill_constant_map.emplace(key, &instr->outputs[0]);
continue;
Expand Down
2 changes: 1 addition & 1 deletion paddle/cinn/frontend/pass/fill_constant_rewriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class FillConstantRewriterPass : public ProgramPass {
VLOG(3) << "FillConstantRewriterPass Remove " << remove_instr.size()
<< " instruction";

NetBuilder builder("reshape_rewritter_builder");
NetBuilder builder("reshape_rewriter_builder");
for (auto& var : program->GetInputs()) {
builder.CreateInput(var);
}
Expand Down
4 changes: 2 additions & 2 deletions paddle/cinn/hlir/framework/pir/op_mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum MapperType {
};

class OpMapper {
using OprandIndexsFunction = std::function<std::vector<size_t>()>;
using OperandIndexsFunction = std::function<std::vector<size_t>()>;
using AppendAttrFunction =
std::function<void(const ::pir::Operation& op,
utils::AttributeMap& attrs)>; // NOLINT
Expand Down Expand Up @@ -72,7 +72,7 @@ class OpMapper {
OpMapper() { RegisterMapRules(); }
void RegisterMapRules();

std::unordered_map<std::string, OprandIndexsFunction> operand_funcs_;
std::unordered_map<std::string, OperandIndexsFunction> operand_funcs_;
std::unordered_map<std::string, AppendAttrFunction> attr_funcs_;
};

Expand Down
12 changes: 6 additions & 6 deletions paddle/fluid/framework/ir/fusion_group/operation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ void OperationMap::InsertBinaryElementwiseOperations() {
std::string expr,
std::vector<std::string> grad_exprs) {
int type = 0;
int num_oprands = 2;
Insert(type, num_oprands, op_type, expr, grad_exprs, {"X", "Y"}, {"Out"});
int num_operands = 2;
Insert(type, num_operands, op_type, expr, grad_exprs, {"X", "Y"}, {"Out"});
};

// elementwise_add:
Expand Down Expand Up @@ -209,8 +209,8 @@ void OperationMap::InsertMultivariateElementwiseOperations() {
std::string expr,
std::vector<std::string> grad_exprs) {
int type = 0;
int num_oprands = -1;
Insert(type, num_oprands, op_type, expr, grad_exprs, {"X"}, {"Out"});
int num_operands = -1;
Insert(type, num_operands, op_type, expr, grad_exprs, {"X"}, {"Out"});
};

// sum:
Expand All @@ -226,8 +226,8 @@ void OperationMap::InsertMultivariateElementwiseOperations() {
std::string expr,
std::vector<std::string> grad_exprs) {
int type = 0;
int num_oprands = 0;
Insert(type, num_oprands, op_type, expr, grad_exprs, {}, {"Out"});
int num_operands = 0;
Insert(type, num_operands, op_type, expr, grad_exprs, {}, {"Out"});
};
// fill_constant:
insert_handler_without_input("fill_constant", "${str_value}", {});
Expand Down
6 changes: 3 additions & 3 deletions paddle/pir/src/core/parser/ir_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Type IrParser::ParseType() {
// Attribute := BuiltinAttribute | OtherDialectsDefineAttribute
// BuiltinAttribute := Bool | String | Float | Double | Int32 |
// := | Int64 | Pointer | ArrayAttribute
// ArrayAttribute := '[' Atribute(,Attribute)* ']'
// ArrayAttribute := '[' Attribute(,Attribute)* ']'
Attribute IrParser::ParseAttribute() {
auto parenthesis_token = ConsumeToken();
if (parenthesis_token.val_ == "true" || parenthesis_token.val_ == "false") {
Expand Down Expand Up @@ -204,7 +204,7 @@ void IrParser::ParseBlock(Block& block) { // NOLINT
ConsumeAToken("}");
}

// Operation := ValueList ":=" Opname "(" OprandList ? ")" AttributeMap ":"
// Operation := ValueList ":=" Opname "(" OperandList ? ")" AttributeMap ":"
// FunctionType
// FunctionType := "(" TypeList ")" "->" TypeList
Operation* IrParser::ParseOperation() {
Expand Down Expand Up @@ -263,7 +263,7 @@ OpInfo IrParser::ParseOpInfo() {
return ctx->GetRegisteredOpInfo(opname);
}

// OprandList := ValueList
// OperandList := ValueList
// ValueList := ValueId(,ValueId)*
std::vector<Value> IrParser::ParseOperandList() {
ConsumeAToken("(");
Expand Down

0 comments on commit 763b9fd

Please sign in to comment.