Agent skill · writing content · aradotso
torchcode-pytorch-interview-practice
LeetCode-style PyTorch interview practice environment with auto-grading for implementing softmax, attention, GPT-2 and more from scratch.
Why this skill is useful
Provides a curated set of 40 PyTorch problems with automated grading and feedback that the AI wouldn't reliably generate on its own.
What it needs
Requires docker, pip installed locally. About 6k tokens when loaded. Last updated 2026-07-09. 70 stars on the source repository.
What this skill does
TorchCode — PyTorch Interview Practice Skill by ara.so — Daily 2026 Skills collection. TorchCode is a Jupyter-based, self-hosted coding practice environment for ML engineers. It provides 40 curated problems covering PyTorch fundamentals and architectures (softmax, LayerNorm, MultiHeadAttention, GPT-2, etc.) with an automated judge that gives instant pass/fail feedback, gradient verification, and timing — like LeetCode but for tensors. --- Installation & Setup Option 1: Online (zero install) Hugging Face Spaces: https://huggingface.co/spaces/duoan/TorchCode Google Colab: Every notebook has an "Open in Colab" badge Option 2: pip (for use inside Colab or existing environment) Option 3: Docker (pre-built image) Option 4: Build locally make run auto-detects Docker or Podman and falls back to local build if the registry image is unavailable (common on Apple Silicon/arm64). --- Judge API The torchjudge package provides the core API used in every notebook. check() return values Colored pass/fail per test case Correctness check against PyTorch reference implementation Gradient verification (autograd compatibility) Timing measurement --- Problem Set Overview Difficulty levels: Easy → Medium → Hard # Problem Key Concepts --- --------- -------------- 1 ReLU Activation functions, element-wise ops 2 Softmax Numerical stability, exp/log tricks 3 Linear Layer y = xW^T + b, Kaiming init, nn.Parameter 4 LayerNorm Normalization, affine transform 5 Self-Attention QKV projections, scaled dot-product 6 Multi-Head Attention Head splitting, concatenation 7 BatchNorm Batch vs layer statistics, train/eval 8 RMSNorm LLaMA-style norm 16 Cross-Entropy Loss Log-softmax, logsumexp trick 17 Dropout Train/eval mode, inverted scaling 18 Embedding Lookup table, weight[indices] 19 GELU torch.erf, Gaussian error linear unit 20 Kaiming Init std = sqrt(2/fanin) 21 Gradient Clipping Norm-based clipping 31 Gradient Accumulation Micro-batching, loss scaling 40 Linear Regression Normal equation, GD from scra …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aradotso/torchcode-pytorch-interview-practice