We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f5bc7a commit a820df6Copy full SHA for a820df6
torchao/__init__.py
@@ -26,6 +26,10 @@
26
logger = logging.getLogger(__name__)
27
28
29
+def is_fbcode():
30
+ return not hasattr(torch.version, "git_version")
31
+
32
33
def _parse_version(version_string):
34
"""
35
Parse version string representing pre-release with -1
@@ -48,7 +52,7 @@ def _parse_version(version_string):
48
52
force_skip_loading_so_files = (
49
53
os.getenv("TORCHAO_FORCE_SKIP_LOADING_SO_FILES", "0") == "1"
50
54
)
51
-if force_skip_loading_so_files:
55
+if force_skip_loading_so_files or is_fbcode():
56
# user override
57
# users can set env var TORCHAO_FORCE_SKIP_LOADING_SO_FILES=1 to skip loading .so files
58
# this way, if they are using an incompatbile torch version, they can still use the API by setting the env var
0 commit comments