flake8 plugin which recommends some tricks for machine learning codes.
The plugin requires python3.10+.
Run flake8 with the plugin without installation:
uvx --with flake8-tensors flake8 .Or install as a UV tool:
uv tool install flake8 --with flake8-tensorsAlternatively, install with pip:
pip install flake8_tensors --upgradeAfter the code is installed, call flake8 on your project. The plugin emits warning messages with "WT" prefix, e.g. WT100.
The messages meant to refer my opinionated best practices, or cool projects, like einops, opt_einsum, Adabelief, etc.
If you don't understand a warning, open a ticket, and i will clarify it. If you have suggestions, let me know. And of course, if you find a false positive, share the problematic snippet. (False positives are absolutely possible, actually, quite easy to make one. But assuming reasonable developer practices, like not calling your variable as "BatchNorm3d", the false positive rate should be low.)