pytorch-debug

Trace PyTorch tensors to diagnose runtime errors and propose fixes.

11|1|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/michaelrizvi/claude-config --skill pytorch-debug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytorch-debug
Source: https://github.com/michaelrizvi/claude-config/tree/main/skills/pytorch-debug
Command: npx skills add https://github.com/michaelrizvi/claude-config --skill pytorch-debug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Debug PyTorch runtime errors by tracing tensors from source to error points and proposing actionable fixes.

Core Features & Use Cases

  • Trace tensors through the data path from dataloader to model outputs to locate where dtype, device, shape, gradient, or memory issues originate
  • Detect and diagnose common PyTorch issues such as dtype mismatches, device placement, shape mismatches, gradient problems, and OOM errors
  • Provide structured diagnostic steps and lightweight code snippets to guide fixes in typical ML workflows

Quick Start

Trace the full data flow of a failing PyTorch tensor and propose an initial diagnosis.

Frequently Asked Questions about pytorch-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug PyTorch runtime errors like dtype mismatches and device placement issues?

Debug PyTorch runtime errors by tracing tensors from the dataloader to model outputs to locate where dtype, device, shape, gradient, or memory issues originate, then apply structured diagnostic steps to resolve them.

What is the best way to trace PyTorch tensor data flow to find shape mismatches?

Trace PyTorch tensor data flow by validating tensor transformations from source to error points, pinpointing the exact layer where shape mismatches occur and providing lightweight code snippets to guide fixes.

Why does my PyTorch training pipeline throw out of memory errors?

Out of memory errors in PyTorch training pipelines occur during tensor transformations and can be diagnosed by enforcing a trace-based debugging workflow that validates data flow and provides actionable diagnostics to guide memory fixes.

Can I use this to diagnose gradient problems in my model development workflow?

Yes, you can diagnose gradient problems in model development workflows by applying a trace-based debugging workflow that validates tensor data flow and detects gradient issues alongside dtype, device, and shape problems.

Does this approach provide code snippets to fix PyTorch tensor issues?

Yes, this approach provides structured diagnostic steps and lightweight code snippets to guide fixes for dtype mismatches, device placement, shape issues, gradient problems, and OOM errors in typical ML workflows.