File tree Expand file tree Collapse file tree 2 files changed +32
-22
lines changed
Expand file tree Collapse file tree 2 files changed +32
-22
lines changed Original file line number Diff line number Diff line change @@ -15,4 +15,14 @@ repos:
1515 rev : v1.39.2
1616 hooks :
1717 - id : typos
18- args : [--force-exclude]
18+ args : [--force-exclude]
19+
20+ - repo : https://github.com/Lucas-C/pre-commit-hooks.git
21+ rev : v1.5.1
22+ hooks :
23+ - id : remove-crlf
24+ - id : remove-tabs
25+ name : Tabs remver (Python)
26+ files : (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
27+ args : [--whitespaces-count, '4']
28+ exclude : test/dygraph_to_static/test_error.py
Original file line number Diff line number Diff line change 1- __all__ = ["torch" , "paddle" ]
2-
3- from importlib import import_module
4- from typing import TYPE_CHECKING , Any , List
5-
6-
7- def __getattr__ (name : str ) -> Any :
8- if name in __all__ :
9- module = import_module (f"{ __name__ } .{ name } " )
10- globals ()[name ] = module
11- return module
12- raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
13-
14-
15- def __dir__ () -> List [str ]:
16- return sorted (list (globals ().keys ()) + __all__ )
17-
18-
19- if TYPE_CHECKING :
20- from . import torch as torch # type: ignore
21- from . import paddle as paddle # type: ignore
1+ __all__ = ["torch" , "paddle" ]
2+
3+ from importlib import import_module
4+ from typing import TYPE_CHECKING , Any , List
5+
6+
7+ def __getattr__ (name : str ) -> Any :
8+ if name in __all__ :
9+ module = import_module (f"{ __name__ } .{ name } " )
10+ globals ()[name ] = module
11+ return module
12+ raise AttributeError (f"module { __name__ !r} has no attribute { name !r} " )
13+
14+
15+ def __dir__ () -> List [str ]:
16+ return sorted (list (globals ().keys ()) + __all__ )
17+
18+
19+ if TYPE_CHECKING :
20+ from . import torch as torch # type: ignore
21+ from . import paddle as paddle # type: ignore
You can’t perform that action at this time.
0 commit comments