Skip to content

Commit

Permalink
remove temporary import in the try catch
Browse files Browse the repository at this point in the history
Summary:
Tensordict is external dependence from PyTorch atm.

this diff is to resolve the failed tests in T212157585

Reviewed By: sarckk

Differential Revision: D66772947
  • Loading branch information
TroyGarden authored and facebook-github-bot committed Jan 9, 2025
1 parent 27e8101 commit 144d79f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 30 deletions.
7 changes: 0 additions & 7 deletions torchrec/distributed/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@
except OSError:
pass

try:
from tensordict import TensorDict
except ImportError:

class TensorDict:
pass


logger: logging.Logger = logging.getLogger(__name__)

Expand Down
7 changes: 0 additions & 7 deletions torchrec/distributed/embeddingbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@
except OSError:
pass

try:
from tensordict import TensorDict
except ImportError:

class TensorDict:
pass


def _pin_and_move(tensor: torch.Tensor, device: torch.device) -> torch.Tensor:
return (
Expand Down
8 changes: 0 additions & 8 deletions torchrec/modules/embedding_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor, KeyedTensor


try:
from tensordict import TensorDict
except ImportError:

class TensorDict:
pass


@torch.fx.wrap
def reorder_inverse_indices(
inverse_indices: Optional[Tuple[List[str], torch.Tensor]],
Expand Down
8 changes: 0 additions & 8 deletions torchrec/sparse/jagged_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@
except OSError:
pass

# OSS
try:
from tensordict import TensorDict
except ImportError:

class TensorDict:
pass


logger: logging.Logger = logging.getLogger()

Expand Down

0 comments on commit 144d79f

Please sign in to comment.