What problem does it solve? Writing PyTorch code that is device-agnostic, reproducible, and memory-efficient requires knowing many idioms and avoiding subtle bugs like forgetting model.eval(), breaking autograd with in-place operations, or misconfiguring DataLoaders. This Skill provides vetted patterns and anti-patterns so deep learning code is correct and performant from the start. ## Core Features & Use Cases - Training and Evaluation Loops: Complete patterns for train_one_epoch and evaluate functions with mixed precision, gradient clipping, and proper train/eval mode handling. - Data Pipeline Patterns: Custom Dataset classes, optimized DataLoader configuration with pin_memory and persistent_workers, and collate functions for variable-length sequences. - Checkpointing and Optimization: Full checkpoint save/load with optimizer state, gradient checkpointing for large models, and torch.compile for faster execution. - Use Case: When writing a new image classifier training script, apply these patterns to get a device-agnostic, reproducible pipeline with AMP mixed precision and resumable checkpoints instead of debugging shape mismatches and GPU memory errors. ## Quick Start Ask the assistant to write a PyTorch training loop for an image classifier following best practices with mixed precision and checkpointing.