Skip to content

Commit

Permalink
Skip depending on torch testing package (pytorch#235)
Browse files Browse the repository at this point in the history
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:
  • Loading branch information
jerryzh168 authored May 9, 2024
1 parent 86c2a25 commit 8c3a3f8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions torchao/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
)
from . import dtypes
import torch
from torch.testing._internal.common_utils import IS_FBCODE
if not IS_FBCODE:
_IS_FBCODE = (
hasattr(torch._utils_internal, "IS_FBSOURCE") and
torch._utils_internal.IS_FBSOURCE
)

if not _IS_FBCODE:
from . import _C
from . import ops

Expand Down

0 comments on commit 8c3a3f8

Please sign in to comment.