Skip to content

Commit

Permalink
fix py3.9 build
Browse files Browse the repository at this point in the history
Summary: The `|` operator is only supported for python >= 3.10, which breaks python 3.9 build

Differential Revision: D67723223
  • Loading branch information
sarckk authored and facebook-github-bot committed Dec 30, 2024
1 parent f059a49 commit 2656ad4
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 2656ad4

Please sign in to comment.