Shape inference for PyTorch tensors directly inside VS Code. The extension bundles the shapels language server binary for Linux, macOS and Windows so users can get diagnostics without extra setup.
Features
Reports tensor shape inference diagnostics as you type.
Runs inference for tensor shapes, allowing for hovering over variables to inspect their shape.
Requirements
No external dependencies. The platform-specific server binary is shipped inside the extension (shapels-bin/<platform>/shapels).
Extension Settings
shapels.serverPath: Override the bundled server binary path.
Release Notes
0.4.1
Minor bug fixes:
Improved diagnostics on some calls using non-existing dimensions of a tensor.
Removed spurious diagnostics on caller site for not understood dimensions on the callee.
0.4.0
Inference now propagates through calls to instances of torch.nn.Module to the respective forward method.
Inference also propagates across non-forward methods for caller–callee analysis.
Inference runs through control flow (if, for, while) rather than skipping branches.
Functional convolution ops are supported.
New broadcastable operation groups: functional elementwise ops (torch.add/torch.div etc.) and broadcastable comparisons (with boolean dtype output).
Bitwise operator support added for tensor operations.
New repeat/expand family support: torch.expand, torch.repeat, and torch.repeat_interleave.
View/reshape ops expanded: torch.flatten, torch.ravel, plus spatial transforms flip and rot90.
Creation op coverage widened with *_like ops and range/lin/logspace (plus randperm) creation.
Partial support added for masked_fill.
New CLI to analyze a single file and print results to stdout.