Feature your MCP

Pytorch Patterns

Community

MIT · Updated Nov 6, 2026

/About Pytorch Patterns

This skill provides idiomatic PyTorch patterns and best practices that the assistant follows when helping with deep learning code. It covers device-agnostic code, reproducible seeding, tensor shape management, clean model architecture, proper weight initialization, training and validation loops, data pipelines, checkpointing, and performance optimizations like mixed precision, gradient checkpointing, and torch.compile.

It also flags common anti-patterns, such as forgetting model.eval(), breaking autograd with in-place operations, and saving full models instead of state_dicts.

AI-generated listing based on the project's public information. It may contain errors: check the original source.

/What Pytorch Patterns is for

Write a new PyTorch model or training script with best practices
Review my deep learning code for common mistakes
Debug my training loop or data pipeline
Optimize GPU memory usage and training speed
Set up a reproducible experiment with fixed seeds and checkpointing