Skip to content

Commit

Permalink
amend
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Jul 9, 2024
1 parent edc315b commit b2fa826
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tensordict/_lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@
_has_functorch = False
try:
try:
from torch._C._functorch import (
from torch._C._functorch import ( # @manual=fbcode//caffe2:_C
_add_batch_dim,
_remove_batch_dim,
is_batchedtensor,
)
except ImportError:
from functorch._C import is_batchedtensor
from functorch._C import is_batchedtensor # @manual=fbcode//caffe2/functorch:_C

_has_functorch = True
except ImportError:
Expand Down
4 changes: 2 additions & 2 deletions tensordict/_td.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
_has_functorch = False
try:
try:
from torch._C._functorch import (
from torch._C._functorch import ( # @manual=fbcode//caffe2:_C
_add_batch_dim,
_remove_batch_dim,
is_batchedtensor,
)
except ImportError:
from functorch._C import is_batchedtensor
from functorch._C import is_batchedtensor # @manual=fbcode//functorch:_C

_has_functorch = True
except ImportError:
Expand Down
10 changes: 8 additions & 2 deletions tensordict/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@

try:
try:
from functorch._C import get_unwrapped, is_batchedtensor
from torch._C._functorch import ( # @manual=fbcode//caffe2:_C
get_unwrapped,
is_batchedtensor,
)
except ImportError:
from torch._C._functorch import get_unwrapped, is_batchedtensor
from functorch._C import (
get_unwrapped,
is_batchedtensor,
) # @manual=fbcode//functorch:_C
except ImportError:
pass

Expand Down

0 comments on commit b2fa826

Please sign in to comment.