Skip to content

Instantly share code, notes, and snippets.

View scturtle's full-sized avatar
🐢

scturtle

🐢
View GitHub Profile
import os
import torch
import torch.distributed as dist
import lovely_tensors as lt; lt.monkey_patch()
def split_tensor(data: torch.Tensor, dim: int) -> torch.Tensor:
rank = dist.get_rank()
world_size = dist.get_world_size()
@rougier
rougier / nano.el
Created February 4, 2025 18:48
NANO Emacs (minimal version: 256 lines)
;; nano-emacs.el --- NANO Emacs (minimal version) -*- lexical-binding: t -*-
;; Copyright (c) 2025 Nicolas P. Rougier
;; Released under the GNU General Public License 3.0
;; Author: Nicolas P. Rougier <[email protected]>
;; URL: https://github.com/rougier/nano-emacs
;; This is NANO Emacs in 256 lines, without any dependency
;; Usage (command line): emacs -Q -l nano.el -[light|dark]