← all repositories
duoan/TorchCode

Whiteboard coding for tensors: no dry-erase required

A LeetCode-style gym where you implement softmax, attention, and GPT-2 blocks from scratch, with instant auto-grading.

4.1k stars Jupyter Notebook Learning
TorchCode
Velocity · 7d
+43
★ / day
Trend
steady
star history

What it does

TorchCode is a self-hosted, Jupyter-based practice platform with 40 curated PyTorch problems. You write LayerNorm, MultiHeadAttention, or full Transformer blocks from memory — the way ML interviews actually work — and an automated judge checks correctness, gradients, and timing on the spot.

The interesting bit

The project treats tensor manipulation as a competitive-programming skill rather than a research exercise. Each notebook includes hints, reference solutions, and a one-click reset so you can grind the same problem repeatedly without copy-paste cheating. There’s even a standalone Next.js + FastAPI IDE if Jupyter feels too 2015.

Key highlights

  • 40 problems ranked by interview frequency (🔥 = very likely, ⭐ = common, 💡 = emerging)
  • Auto-graded correctness checks with colored pass/fail per test case
  • torch-judge pip package for Colab usage without cloning
  • Docker/Podman one-liner (make run) or zero-install Hugging Face Spaces demo
  • Every notebook has an “Open in Colab” badge for instant cloud runs

Caveats

  • Pre-built Docker image may fail on Apple Silicon / arm64; local build fallback required
  • README is truncated mid-problem-list in the source, so full curriculum depth is unclear

Verdict

Anyone sweating ML engineering interviews at Meta, DeepMind, or OpenAI should bookmark this. If you already write custom CUDA kernels for fun, you’ll outgrow it fast.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.