Skip to content

Commit

Permalink
add lazy getitem to vle and ebc vbe awaitables
Browse files Browse the repository at this point in the history
Summary: defer wait for lazy awaitable to after result of `__getitem__` is used

Differential Revision: D55765164
  • Loading branch information
joshuadeng authored and facebook-github-bot committed Apr 5, 2024
1 parent 4020e16 commit 5e7d32a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torchrec/distributed/embeddingbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ def construct_output_kt(
)


class VariableBatchEmbeddingBagCollectionAwaitable(LazyAwaitable[KeyedTensor]):
class VariableBatchEmbeddingBagCollectionAwaitable(
LazyGetItemMixin[str, torch.Tensor], LazyAwaitable[KeyedTensor]
):
def __init__(
self,
awaitables: List[Awaitable[torch.Tensor]],
Expand Down

0 comments on commit 5e7d32a

Please sign in to comment.