Skip to content

Commit

Permalink
fix py3.9 build (#2660)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2660

The `|` operator is only supported for python >= 3.10, which breaks python 3.9 build

Reviewed By: dstaay-fb

Differential Revision: D67723223

fbshipit-source-id: a49208aa8d819c3047b75a52ab7ba6cb6c2638b8
  • Loading branch information
sarckk authored and facebook-github-bot committed Dec 31, 2024
1 parent ff03e14 commit 455de88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion torchrec/distributed/mc_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@

@dataclass
class EmbeddingCollectionContext(Multistreamable):
sharding_contexts: List[InferSequenceShardingContext | SequenceShardingContext]
sharding_contexts: List[
Union[InferSequenceShardingContext, SequenceShardingContext]
]

def record_stream(self, stream: torch.Stream) -> None:
for ctx in self.sharding_contexts:
Expand Down

0 comments on commit 455de88

Please sign in to comment.