# duoan/TorchCode

🔥 LeetCode for PyTorch — practice implementing softmax, attention, GPT-2 and more from scratch with instant auto-grading. Jupyter-based, self-hosted or try online.

Repository: https://github.com/duoan/TorchCode
Canonical: https://ross.abutalabs.com/products/torchcode
Homepage: https://huggingface.co/spaces/duoan/TorchCode
Language: Jupyter Notebook
License Family: other
Topics: interview, leetcode, pytorch
Last push: 2026-07-31T02:30:18+00:00

## Health v2 (maintenance only)
Score: 58/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 95, release rhythm 35, longevity 13
- inputs: {"age_days": 182, "days_push": 34, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4523, forks 402 (observed 2026-08-28T04:08:52.820856+00:00)

## What it is
TorchCode is a LeetCode-style interactive practice platform for PyTorch, offering 41 curated problems (softmax, LayerNorm, MultiHeadAttention, GPT-2, etc.) with instant automated grading, hints, and reference solutions. It is Jupyter-based, self-hostable via Docker, and also runnable online or in Google Colab with no GPU required.

## Use cases
- practice implementing softmax and attention from scratch in pytorch
- prepare for machine learning engineer interview coding questions
- learn to implement transformer blocks like gpt-2 from scratch
- find leetcode-style exercises for pytorch with auto-grading
- self-host a jupyter-based pytorch practice environment
- test my understanding of layer norm and multi-head attention implementations
- get hands-on pytorch exercises with instant feedback

## When to choose
- you are preparing for ML/PyTorch interviews that test from-scratch operator and architecture implementations
- you want structured, auto-graded practice with hints and reference solutions
- you prefer a zero-setup, Jupyter/Colab-based workflow without needing a GPU

## When to avoid
- you need a general-purpose PyTorch library or production training framework rather than practice exercises
- you want a broad algorithm/data-structures LeetCode alternative unrelated to tensors
- you require a formally licensed project - the repository lists no license

## Facets
- artifact type: learning-resource
- maturity: active
- function: machine-learning, developer-tools, testing
- domain: deep-learning, education, tutorials, machine-learning
- platform: python, cross-platform
- tags: pytorch, interview-preparation, leetcode-style, jupyter, auto-grading, transformers, self-hosted, practice-problems, docker, web-server

## Member repositories
- duoan/TorchCode (main) score 58

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:52.820856+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:20:15.897312+00:00, confidence not recorded.
  - readme: https://github.com/duoan/TorchCode (fetched 2026-08-28T04:08:52.820856+00:00, sha 4806d023d278)
  - homepage: https://huggingface.co/spaces/duoan/TorchCode (fetched 2026-08-29T09:06:01.179591+00:00, sha 0527f2e50188)
- Data as of 2026-08-30T08:39:29.467469+00:00.
