# torchcode-pytorch-interview-practice

A practice environment for PyTorch coding interviews: 40 problems with auto-grading, gradient checks and timing. Useful before an ML interview loop.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 798 installs · ★ 88
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/torchcode-pytorch-interview-practice/SKILL.md
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/skills/torchcode-pytorch-interview-practice

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/torchcode-pytorch-interview-practice/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/torchcode-pytorch-interview-practice/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/torchcode-pytorch-interview-practice/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/torchcode-pytorch-interview-practice/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/trending-skills torchcode-pytorch-interview-practice
```

2. **Manually: put the files in place**
- File: `.github/skills/torchcode-pytorch-interview-practice/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/trending-skills --path skills/torchcode-pytorch-interview-practice
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/torchcode-pytorch-interview-practice/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/trending-skills --skill torchcode-pytorch-interview-practice -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/trending-skills/tree/HEAD/skills/torchcode-pytorch-interview-practice/SKILL.md

## When to use it
- 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
- List the problems and my progress with `status()`
- Check my `layernorm` implementation with `check("layernorm")`
- Give me a hint for the `attention` problem without spoilers

## Similar
- [skill-creator](https://affpapa.org/en/nevibecode/skills/skill-creator.md) — skill · 414180 installs
- [writing-for-agents](https://affpapa.org/en/nevibecode/skills/writing-for-agents.md) — skill · 466719 installs
- [media-use](https://affpapa.org/en/nevibecode/skills/media-use.md) — skill · 1100000 installs
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [subagent-driven-development](https://affpapa.org/en/nevibecode/skills/subagent-driven-development.md) — skill · 237746 installs
- [orchestration](https://affpapa.org/en/nevibecode/skills/orchestration.md) — skill · 349800 installs

From the same set: [reason-machines/trending-skills](https://affpapa.org/en/nevibecode/by/reason-machines/trending-skills.md) — 139 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
