Skip to content

Instantly share code, notes, and snippets.

View nmichlo's full-sized avatar
🐋

Nathan nmichlo

🐋
View GitHub Profile
@nmichlo
nmichlo / array_chunking.py
Last active July 3, 2025 10:35
Torch & NumPy redistributed splitting/chunking
# BASED ON @nmichlo's ISSUE AT:
# https://github.com/pytorch/pytorch/issues/60531
# NOTE: modern features of torch and numpy make this easier to implement in python
# as modern one liners.
##### TORCH EXAMPLE #####
# chunks = 3
# dim = 0
# tensor = torch.arange(7)