PyTorch Utilities
Two small tools for the everyday friction of working with PyTorch.
- Role
- Design and engineering
- Areas
- AI, Tools

Two problems come up again and again in machine learning work: getting a PyTorch install that matches the machine, and figuring out what's in a checkpoint someone handed over. We wrote a small tool for each.
TorchVersionSpecifier
PyTorch, TorchVision and Torchaudio releases are tied to specific Python and CUDA versions, and working out a matching set by hand is tedious and easy to get wrong across many environments. Give TorchVersionSpecifier a Python version, a CUDA version and optionally a build variant such as cpu, and it lists the compatible version triples, ready to paste into a pip install. It pulls compatibility data directly from the PyTorch release sources, so it keeps up with new releases. It runs from the command line, in an interactive mode, or as a Gradio app.
TorchModelAnalyzer
A .pth file can hold a bare state dict, an optimizer state, params, params_ema or a whole pickled model, and the only way to tell is to load it and look. TorchModelAnalyzer does the looking: it reports the top-level keys, parameter counts and tensor shapes for each, the module hierarchy for saved models, and a summary of what the file contains, all as JSON that can be saved and compared between models.

