Agent skill · Data & Analytics

pytorch-patterns

PyTorch deep learning patterns and best practices for building robust, efficient, and reproducible training pipelines, model architectures, and data loading.

mturacgithub.com/mturacGitHub ↗
codexcopilotcursorMIT
Install
npx skills add mturac/everything-openai-codex --skill pytorch-patterns --agent codex

Same command for any agent — swap --agent for claude-code, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 11 KB
Bundled scripts: none
Path: skills/pytorch-patterns/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 84
Language: JavaScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# PyTorch Development Patterns Idiomatic PyTorch patterns and best practices for building robust, efficient, and reproducible deep learning applications. ## When to Activate - Writing new PyTorch models or training scripts - Reviewing deep learning code - Debugging training loops or data pipelines - Optimizing GPU memory usage or training speed - Setting up reproducible experiments ## Core Principles ### 1. Device-Agnostic Code Always write code that works on both CPU and GPU without hardcoding devices. ```python # Good: Device-agnostic device = torch.device("cuda" if torch.cuda.is_available() else "cpu") model = MyModel().to(device) data = data.to(device) # Bad: Hardcoded device model = MyModel().cuda() # Crashes if no GPU data = data.cuda() ``` ### 2. Reproducibility First Set all random seeds for reproducible results. ```python # Good: Full reproducibility setup def set_seed(seed: int = 42) -> None: torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) np.random.seed(seed) random.seed(seed) torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False # Bad: No seed control model = MyModel() # Different weights every run ``` ### 3. Explicit Shape Management

What's inside
Steps it walks through
  1. When to Activate
  2. Core Principles
  3. 1. Device-Agnostic Code
  4. 2. Reproducibility First
  5. 3. Explicit Shape Management
  6. Model Architecture Patterns
  7. Clean nn.Module Structure
  8. Proper Weight Initialization
  9. Training Loop Patterns
  10. Standard Training Loop
  11. Validation Loop
  12. Data Pipeline Patterns
  13. Custom Dataset
  14. Efficient DataLoader Configuration
More from everything-openai-codex
All skills →
About this skill
What does the pytorch-patterns skill do?

PyTorch deep learning patterns and best practices for building robust, efficient, and reproducible training pipelines, model architectures, and data loading.

How do I install it?

Run `npx skills add mturac/everything-openai-codex --skill pytorch-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going