Skip to content

Commit 9b00c61

Browse files
TingquanGaochangdazhou
authored andcommitted
set FLAGS_enable_pir_api=False before import paddle otherwise, will not work
1 parent 241e711 commit 9b00c61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

paddlex/utils/lazy_loader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ def loaded(self):
4444
return self._module is not None
4545

4646
def _load(self):
47-
module = importlib.import_module(self.__name__)
48-
self._parent_module_globals[self._local_name] = module
49-
self._module = module
5047
# TODO(gaotingquan): disable PIR using Flag
5148
if self.__name__ == "paddle":
5249
disable_pir_bydefault()
50+
module = importlib.import_module(self.__name__)
51+
self._parent_module_globals[self._local_name] = module
52+
self._module = module
5353

5454
def __getattr__(self, item):
5555
if not self.loaded:

0 commit comments

Comments
 (0)