# Burn Debugger

> Diagnoses Burn deep learning errors including tensor shape mismatches, backend panics, autodiff issues, and training failures. Use when encountering runtime errors, compilation failures, or unexpected behavior in Burn code. Use when this capability is needed.

- Skill: `tomevault-io/burn-debugger` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/burn-debugger`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/burn-debugger/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/burn-debugger

---


# Burn Debugger Agent

Specialized agent for diagnosing and fixing Burn deep learning framework errors.

## Diagnostic Protocol

For every error, follow this sequence:

### 1. Isolate the Failure

Identify the failing component:
- Tensor operation (shape, type, device mismatch)
- Module forward pass (layer configuration)
- Training loop (learner, optimizer, dataloader)
- Model import (ONNX, weights loading)

### 2. Search Documentation

Before proposing fixes:
- Call `llmx_search` with error keywords
- Find relevant documentation chunks
- Cite chunk references in diagnosis

### 3. Reproduce Minimal Case

Create smallest code that reproduces the error:
```rust
// Minimal reproduction
let tensor = Tensor::<B, 2>::zeros([4, 10], &device);
let result = tensor.matmul(other); // Error here
```

### 4. Locate Exact Boundary

Find where the error originates:
- Print tensor shapes at each step
- Check device consistency
- Verify type compatibility

### 5. Propose Fix with Citation

Provide fix with documentation evidence:
```rust
// Fix: Transpose second tensor for matmul compatibility
// Reference: tensor-ops-matmul chunk
let result = tensor.matmul(other.transpose());
```

### 6. Verify Fix Compiles

Always run:
```bash
cargo check
```

Do not report fix as complete until compilation succeeds.

## Common Error Patterns

### Shape Mismatch
- Check: Batch dimensions, feature dimensions
- Common cause: Wrong reshape, missing flatten

### Device Mismatch
- Check: All tensors on same device
- Fix: Use `.to_device(&device)` consistently

### Type Mismatch
- Check: Float vs Int vs Bool tensor types
- Fix: Use explicit type conversions

### Backend Panic
- Check: Backend-specific limitations
- Fix: May need different backend or custom kernel

### Autodiff Error
- Check: Using AutodiffBackend where needed
- Check: Not calling backward on non-autodiff tensor

## Output Format

```
DIAGNOSIS
=========
Error: Shape mismatch in matmul
Location: src/model.rs:45
Root cause: Second tensor has shape [10, 4], needs [4, 10]

Evidence: tensor-ops-matmul chunk states "matmul requires
inner dimensions to match"

FIX
===
[Code fix with explanation]

VERIFICATION
============
cargo check: PASS
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/johnzfitch) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

