From 36d6f76d27767c87a44b10da9e9fb9153f45e2b0 Mon Sep 17 00:00:00 2001 From: Huang Kerui <1814071380@qq.com> Date: Thu, 19 Dec 2024 23:20:09 +0800 Subject: [PATCH 1/2] Fix: keyward, Keyward Undo: kinf, kow --- _typos.toml | 2 -- .../dialect/operator/transforms/pir_to_py_code_converter.cc | 4 ++-- python/paddle/jit/dy2static/program_translator.py | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/_typos.toml b/_typos.toml index 9f359a9e3b6e89..8ed85305fa4599 100644 --- a/_typos.toml +++ b/_typos.toml @@ -266,8 +266,6 @@ kenerl = 'kenerl' kernerl = 'kernerl' Kernal = 'Kernal' kerenl = 'kerenl' -Keyward = 'Keyward' -keyward = 'keyward' kinf = 'kinf' kow = 'kow' lable = 'lable' diff --git a/paddle/cinn/hlir/dialect/operator/transforms/pir_to_py_code_converter.cc b/paddle/cinn/hlir/dialect/operator/transforms/pir_to_py_code_converter.cc index 3ef4809dd28efe..d234f8dd78e32b 100644 --- a/paddle/cinn/hlir/dialect/operator/transforms/pir_to_py_code_converter.cc +++ b/paddle/cinn/hlir/dialect/operator/transforms/pir_to_py_code_converter.cc @@ -487,7 +487,7 @@ struct PirToPyCodeConverterHelper { const auto& args = block.args(); return std::find(args.begin(), args.end(), value) != args.end(); }; - const auto IsBlockKeywardArg = [&](pir::Value value) { + const auto IsBlockKeywordArg = [&](pir::Value value) { const auto& kwargs = block.kwargs(); for (const auto& [_, kwarg] : kwargs) { if (kwarg == value) return true; @@ -499,7 +499,7 @@ struct PirToPyCodeConverterHelper { if (std::find(inputs.begin(), inputs.end(), value) != inputs.end()) continue; if (IsBlockPositionalArg(value)) continue; - if (IsBlockKeywardArg(value)) continue; + if (IsBlockKeywordArg(value)) continue; inputs.push_back(value); } return inputs; diff --git a/python/paddle/jit/dy2static/program_translator.py b/python/paddle/jit/dy2static/program_translator.py index aabbfb8802477d..d586d6b659aa17 100644 --- a/python/paddle/jit/dy2static/program_translator.py +++ b/python/paddle/jit/dy2static/program_translator.py @@ -527,7 +527,7 @@ def __call__(self, *args: _InputT.args, **kwargs: _InputT.kwargs) -> _RetT: Args: *args(tuple): tuple of all input arguments from original decorated function. - **kwargs(dict): dict of all input keyward arguments from original decorated function. + **kwargs(dict): dict of all input keyword arguments from original decorated function. Return: Outputs of decorated function. @@ -576,7 +576,7 @@ def _call_dygraph_function( Args: *args(tuple): tuple of all input arguments from original decorated function. - **kwargs(dict): dict of all input keyward arguments from original decorated function. + **kwargs(dict): dict of all input keyword arguments from original decorated function. Return: Outputs of dygraph function. From a9d210ba13a0920694a4f9cd6f8b7400a5b9e6f0 Mon Sep 17 00:00:00 2001 From: Huang Kerui <1814071380@qq.com> Date: Fri, 20 Dec 2024 01:02:59 +0800 Subject: [PATCH 2/2] Move kow kinf --- _typos.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_typos.toml b/_typos.toml index 8ed85305fa4599..5d35208a566b4c 100644 --- a/_typos.toml +++ b/_typos.toml @@ -21,6 +21,8 @@ cll = 'cll' dout = "dout" eles = 'eles' grad = "grad" +kinf = 'kinf' +kow = 'kow' lod = "lod" Nce = "Nce" Nd = "Nd" @@ -266,8 +268,6 @@ kenerl = 'kenerl' kernerl = 'kernerl' Kernal = 'Kernal' kerenl = 'kerenl' -kinf = 'kinf' -kow = 'kow' lable = 'lable' lamda = 'lamda' labmda = 'labmda'