Skip to content

Commit ad12663

Browse files
authored
Skip depending on torch testing package (#235)
Summary: We used to do ``` from torch.testing._internal.common_utils import IS_FBCODE ``` but this caused some internal failures, so we'll just copy paste the code for `IS_FBCODE` so that we don't depend on the testing package Test Plan: internal CI Reviewers: Subscribers: Tasks: Tags:
1 parent 0c5c814 commit ad12663

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

torchao/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
)
66
from . import dtypes
77
import torch
8-
from torch.testing._internal.common_utils import IS_FBCODE
9-
if not IS_FBCODE:
8+
_IS_FBCODE = (
9+
hasattr(torch._utils_internal, "IS_FBSOURCE") and
10+
torch._utils_internal.IS_FBSOURCE
11+
)
12+
13+
if not _IS_FBCODE:
1014
from . import _C
1115
from . import ops
1216

0 commit comments

Comments
 (0)