Skip to content

Commit f98034c

Browse files
kumperafacebook-github-bot
authored andcommitted
Document PyTorch's dependency on interpreter_impl.cpp details. (#317)
Summary: PyTorch needs a stable way to detect if it's running under multipy so we document the current workaround as the way to do it to, hopefully, avoid future breakage if it needs to change. Pull Request resolved: #317 Reviewed By: albanD, PaliC Differential Revision: D45061153 Pulled By: kumpera fbshipit-source-id: c207453048afb5eebd0972738282657d823341a2
1 parent 1a88dde commit f98034c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

multipy/runtime/interpreter/interpreter_impl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ import linecache
132132
from zipfile import ZipFile
133133
134134
# Disable Python library registration since it's not compatible with multipy.
135+
# PyTorch depends on this line to detect if it's running under multipy and avoid any dynamic library registration
136+
# >>DO NOT<< change this line without first coordinating with PyTorch
135137
sys.modules["torch._meta_registrations"] = object
136138
137139
class RegisterModuleImporter(importlib.abc.InspectLoader):

0 commit comments

Comments
 (0)