MCPcopy Create free account
hub / github.com/pytorch/tutorials / ExampleAwaitable

Class ExampleAwaitable

intermediate_source/torchrec_intro_tutorial.py:634–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632
633# Demonstrate a ``LazyAwaitable`` type:
634class ExampleAwaitable(LazyAwaitable[torch.Tensor]):
635 def __init__(self, size: List[int]) -> None:
636 super().__init__()
637 self._size = size
638
639 def _wait_impl(self) -> torch.Tensor:
640 return torch.ones(self._size)
641
642
643awaitable = ExampleAwaitable([3, 2])

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected