(shape: tuple[int, ...], count: int)
| 1831 | use_tensor_list = device not in ("cpu", "cuda") |
| 1832 | |
| 1833 | def _alloc_chunks(shape: tuple[int, ...], count: int) -> list[torch.Tensor]: |
| 1834 | chunks = [torch.zeros(shape, dtype=dtype) for _ in range(count)] |
| 1835 | if device in ("cuda"): |
| 1836 | chunks = [chunk.pin_memory() for chunk in chunks] |
| 1837 | return chunks |
| 1838 | |
| 1839 | # --- NHD per-layer --- |
| 1840 | torch.manual_seed(123) |
no outgoing calls
no test coverage detected