torchcode-pytorch-interview-practice — Claude Code skill
A practice environment for PyTorch coding interviews: 40 problems with auto-grading, gradient checks and timing. Useful before an ML interview loop.
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a claude-codeWhat torchcode-pytorch-interview-practice does
The skill walks you through reimplementing PyTorch layers from scratch: softmax, LayerNorm, MultiHeadAttention, GPT-2 and more. Problems are graded easy, medium and hard. Each one lives in its own notebook, with a blank template to work in and a reference solution to read once you have tried it yourself.
Grading comes from the torch_judge package. Calling check("softmax") runs the test cases, compares your output against the PyTorch reference, verifies autograd compatibility and reports timing. hint() gives a nudge without spoiling the answer, reset_progress() clears a problem, and status() lists the problems with your progress.
You can skip installation entirely: the notebooks open in Hugging Face Spaces and Google Colab. To run them in your own environment there is pip install torch-judge, a prebuilt Docker image, or a local build from the repository via make run. That last one detects Docker or Podman and falls back to a local build when the registry image is unavailable, which happens often on Apple Silicon.
What it helps with
- implement softmax with numerical stability
- write MultiHeadAttention with head splitting
- build GPT-2 from its components
- verify an implementation against autograd
- drill PyTorch questions before an interview
Example prompts for the agent
- List the problems and my progress with
status() - Check my
layernormimplementation withcheck("layernorm") - Give me a hint for the
attentionproblem without spoilers
How to install torchcode-pytorch-interview-practice
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a claude-code2Manually: put the files in place
~/.claude/skills/torchcode-pytorch-interview-practice/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/torchcode-pytorch-interview-practice/
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a codex2Manually: put the files in place
.agents/skills/torchcode-pytorch-interview-practice/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a cursor2Manually: put the files in place
.cursor/skills/torchcode-pytorch-interview-practice/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install reason-machines/trending-skills torchcode-pytorch-interview-practice2Manually: put the files in place
.github/skills/torchcode-pytorch-interview-practice/SKILL.md1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a gemini-cli2Platform CLI
gemini skills install https://github.com/reason-machines/trending-skills --path skills/torchcode-pytorch-interview-practiceManually: put the files in place
.devin/skills/torchcode-pytorch-interview-practice/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about torchcode-pytorch-interview-practice
How do I install torchcode-pytorch-interview-practice in Claude Code?
Run npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a claude-code. The skill file lands at ~/.claude/skills/torchcode-pytorch-interview-practice/SKILL.md.
What does torchcode-pytorch-interview-practice do?
It sets up LeetCode-style PyTorch practice: 40 problems on implementing layers from scratch, with auto-grading, gradient verification and timing.
Do I need to install anything to start?
No, the notebooks open in Hugging Face Spaces and Google Colab. For your own environment there is pip install torch-judge, a Docker image, or a local build.