diff --git a/paddle/fluid/ir/dialect/op_generator/ops_api_gen.py b/paddle/fluid/ir/dialect/op_generator/ops_api_gen.py index 529dd1ea3f60c6972dd1b2d514c2fe8e7e67a86a..bde5c7c23a7bce28db8c7c7153249b7394ad03b7 100644 --- a/paddle/fluid/ir/dialect/op_generator/ops_api_gen.py +++ b/paddle/fluid/ir/dialect/op_generator/ops_api_gen.py @@ -95,8 +95,8 @@ class OpsAPIGen(CodeGen): def _gen_one_function_impl(self, name): if ( - name.endswith('grad') - or name.endswith('grad_') + name.endswith('_grad') + or name.endswith('_grad_') or name.endswith('xpu') or name in SPECIAL_STATIC_ONLY_APIS ): diff --git a/python/paddle/_C_ops.py b/python/paddle/_C_ops.py index 9c0104b382c2e0729a81b488497e6d77e568aad1..3dd87313fd5c3351263e9d198306cd5dc8a97002 100644 --- a/python/paddle/_C_ops.py +++ b/python/paddle/_C_ops.py @@ -16,14 +16,11 @@ from paddle.base import core __all__ = [] -UNIFIED_APIS = ['mean', 'concat', 'add_n', 'scale'] - for name in dir(core.eager.ops): globals()[name] = getattr(core.eager.ops, name) __all__.append(name) for name in dir(core.ir.ops): - if name in UNIFIED_APIS: - globals()[name] = getattr(core.ir.ops, name) - if name not in __all__: - __all__.append(name) + globals()[name] = getattr(core.ir.ops, name) + if name not in __all__: + __all__.append(name)