Skip to content

Commit ba4f780

Browse files
edward-iopytorchmergebot
authored andcommitted
fix submodule imports by importing functions directly (pytorch#79368)
Summary: fixes two sporadic issues from missing attributes: - breaking circular imports - submodule not being imported explicitly Test Plan: sandcastle Reviewed By: ehhuang Differential Revision: D37071652 Pull Request resolved: pytorch#79368 Approved by: https://github.com/ananthsub
1 parent 7751ed4 commit ba4f780

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/_ops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import types
77

88
import torch.jit
9-
import torch._utils_internal as torch_utils_internal
9+
from torch import _utils_internal
1010

1111
# Query `hasattr` only once.
1212
_SET_GLOBAL_FLAGS = hasattr(sys, 'getdlopenflags') and hasattr(sys, 'setdlopenflags')
@@ -252,7 +252,7 @@ def load_library(self, path):
252252
if sys.executable == "torch_deploy":
253253
return
254254

255-
path = torch_utils_internal.resolve_library_path(path)
255+
path = _utils_internal.resolve_library_path(path)
256256
with dl_open_guard():
257257
# Import the shared library into the process, thus running its
258258
# static (global) initialization code in order to register custom

0 commit comments

Comments
 (0)