archinetai/surgeon-pytorch
A PyTorch utility for inspecting intermediate model layers and extracting subparts without modifying original model code.

Velocity · 7d
+0.3
★ / day
Trend
→steady
star history
Surgeon-pytorch is a library that enables inspection and extraction of intermediate layers in PyTorch models. It wraps models to capture layer outputs during forward passes, supporting multiple layers, removal of subgraphs, and extraction of model branches for independent use. The tool facilitates debugging, visualization of embeddings, and analysis of attention matrices without requiring changes to the original model implementation.