未验证 提交 2dce4320 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle][py2] use new syntax for metaclass declaration (PEP 3115) (#47730)

上级 433e67bd
develop 1.8.5 add_kylinv10 bugfix-eval-frame-leakgae cherry-pick-fix-customOP-random-fail fix-run-program-grad-node-mem fix_check fix_custom_device_copy_sync fix_dlpack_for fix_newexe_gc hack_event incuabte/new_frl incubate/new_frl incubate/new_frl_rc incubate/stride layer_norm matmul_double_grad operator_opt pass-compile-eval-frame prv-reshape-mkldnn-ut2 release-deleted/2.5 release-rc/2.5 release/2.5 release/llm_2.5 revert-48815-set_free_when_no_cache_hit_default_value_true revert-49499-test_ninja_on_ci revert-49654-prim_api_gen revert-49673-modify_get_single_cov revert-49763-fix_static_composite_gen revert-50158-fix_found_inf_bug_for_custom_optimizer revert-50188-refine_optimizer_create_accumulators revert-50335-fix_optminizer_set_auxiliary_var_bug revert-51676-flag_delete revert-51850-fix_softmaxce_dev revert-52186-deve revert-52523-test_py38 revert-52912-develop revert-53248-set_cmake_policy revert-54029-fix_windows_compile_bug revert-54068-support_translating_op_attribute revert-54214-modify_cmake_dependencies revert-54370-offline_pslib revert-54391-fix_cmake_md5error revert-54411-fix_cpp17_compile revert-54466-offline_pslib revert-54480-cmake-rocksdb revert-55568-fix_BF16_bug1 revert-56328-new_ir_support_vector_type_place_transfer revert-56366-fix_openssl_bug revert-56545-revert-56366-fix_openssl_bug revert-56620-fix_new_ir_ocr_bug revert-56925-check_inputs_grad_semantic revert-57005-refine_stride_flag sd_conv_linear_autocast semi-auto/rule-base support-0D-sort test_for_Filtetfiles v2.5.1 v2.5.0 v2.5.0-rc1 v2.5.0-rc0
无相关合并请求
...@@ -30,7 +30,7 @@ __all__ = ['Fleet', 'DistributedOptimizer'] ...@@ -30,7 +30,7 @@ __all__ = ['Fleet', 'DistributedOptimizer']
__all__ += mode.__all__ __all__ += mode.__all__
class Fleet: class Fleet(metaclass=abc.ABCMeta):
""" """
Fleet is the base class, transpiler and pslib are implementation of Fleet. Fleet is the base class, transpiler and pslib are implementation of Fleet.
...@@ -41,8 +41,6 @@ class Fleet: ...@@ -41,8 +41,6 @@ class Fleet:
None None
""" """
__metaclass__ = abc.ABCMeta
def __init__(self, mode): def __init__(self, mode):
self._is_initialized = False self._is_initialized = False
self._mode = mode self._mode = mode
...@@ -268,7 +266,7 @@ class Fleet: ...@@ -268,7 +266,7 @@ class Fleet:
pass pass
class DistributedOptimizer: class DistributedOptimizer(metaclass=abc.ABCMeta):
""" """
DistributedOptimizer is a wrapper for paddle.fluid.optimizer DistributedOptimizer is a wrapper for paddle.fluid.optimizer
A user should pass a paddle.fluid.optimizer to DistributedOptimizer A user should pass a paddle.fluid.optimizer to DistributedOptimizer
...@@ -287,8 +285,6 @@ class DistributedOptimizer: ...@@ -287,8 +285,6 @@ class DistributedOptimizer:
""" """
__metaclass__ = abc.ABCMeta
def __init__(self, optimizer, strategy=None): def __init__(self, optimizer, strategy=None):
if ( if (
not isinstance(optimizer, SGD.__bases__) not isinstance(optimizer, SGD.__bases__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部