VSCode Array Inspector
A VSCode extension that shows detailed array information (shape, dtype, device) in a sidebar panel during Python debugging sessions.
Features
- Automatic Array Detection: Debug sidebar panel fills up with all JAX, NumPy, and PyTorch arrays/tensors among locals and globals
- Pin Arrays: Pin important arrays to keep them visible across stack frames
- Real-time Updates: Array information updates automatically as you step through code
Usage
- Start a Python debugging session
- The Array Inspector panel will appear in the activity bar
- When you enter a scope, the panel updates with all arrays and tensors in the frame
- See detailed information (shape, dtype, device) appear in the panel
- Click the pin icon to keep an array visible even when out of scope
Pinned Arrays
Pinned arrays stay at the top of the Array Inspector and show:
- Current values when the variable is in scope
- "N/A" when the variable is not available in the current frame
Supported Types
By default, the extension supports:
- JAX arrays (objects of type
jax.Array, jaxlib.xla_extension.ArrayImpl)
- NumPy arrays (
numpy.ndarray)
- PyTorch tensors (
torch.Tensor)
Configuration
Configure which types and attributes to display:
{
"arrayInspector.supportedTypes": [
"jax.Array",
"jaxlib.xla_extension.ArrayImpl",
"numpy.ndarray"
],
"arrayInspector.attributes": [
"shape",
"dtype",
"device"
]
}
Development
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch for changes
npm run watch
Testing
- Open this folder in VSCode
- Press F5 to launch the Extension Development Host
- Open a Python file with JAX/NumPy arrays
- Set a breakpoint and start debugging
- Check out the debugging sidebar to see the Array Inspector panel
License
MIT
| |