Torchscan

Latest version: v0.1.2

Safety actively analyzes 626004 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.2

<p align="center">
<img src="https://github.com/frgfm/torch-scan/releases/download/v0.1.1/logo_text.png" width="40%">
</p>

This release fixes the support of some layers and improves the project quality.

**Note**: torchscan 0.1.2 requires PyTorch 1.5 or higher.

Highlights

:art: Documentation theme

It was time to update the documentation, thus the theme was changed from [Read the Docs](https://sphinx-rtd-theme.readthedocs.io/en/stable/) to [Furo](https://pradyunsg.me/furo/quickstart/) (#61)

![image](https://user-images.githubusercontent.com/26927750/182602586-72681fb4-79b6-493c-980d-52e47b0ba979.png)

This comes with nice features like dark mode and edit button!

:broom: Code quality

Getting a clean, maintainable code base is one of the key catalyst aspects for an OSS project. As such, a few improvements have been made:
- codebase quality : adding annotation typing (30), black formatting (58)
- moved legacy `requirements.txt` to `pyproject.toml` (58, 59)
- added a Makefile for easier development (61)

Breaking changes

:warning: Branch renaming

The `master` branch was renamed into `main` (60), so if you were installing from source a specific branch name, make sure to update this reference!

What's Changed
Breaking Changes 🛠
* docs: Renamed ref from master to main by frgfm in https://github.com/frgfm/torch-scan/pull/60
New Features 🚀
* ci: Added FUNDING button by frgfm in https://github.com/frgfm/torch-scan/pull/71
* docs: Added list of supported layers to documentation by frgfm in https://github.com/frgfm/torch-scan/pull/74
Bug Fixes 🐛
* fix: Fixed RF computation and added effective stride and padding by frgfm in https://github.com/frgfm/torch-scan/pull/33
* chore: Fixed doc deploy by frgfm in https://github.com/frgfm/torch-scan/pull/35
* fix: Fixed MAC/FLOP computation for Linear in higher dimensions by frgfm in https://github.com/frgfm/torch-scan/pull/52
* fix: read encoding with utf-8 by joonas-yoon in https://github.com/frgfm/torch-scan/pull/56
* fix: Fixed GPU RAM estimation by frgfm in https://github.com/frgfm/torch-scan/pull/64
* docs: Fixed author entry in pyproject by frgfm in https://github.com/frgfm/torch-scan/pull/67
* fix: Fixed release job and conda recipe by frgfm in https://github.com/frgfm/torch-scan/pull/75
Improvements
* fix: Fixed support of modules that are used multiple times during forward by frgfm in https://github.com/frgfm/torch-scan/pull/24
* feat: Added support of dilation in receptive field computation by frgfm in https://github.com/frgfm/torch-scan/pull/28
* chore: Added annotation typing by frgfm in https://github.com/frgfm/torch-scan/pull/30
* style: Reorganized print with dynamic column width resolution by frgfm in https://github.com/frgfm/torch-scan/pull/32
* feat: Switched correctly the RF computation order by frgfm in https://github.com/frgfm/torch-scan/pull/34
* style: Fixed annotation typing by frgfm in https://github.com/frgfm/torch-scan/pull/38
* chore: Updated CI jobs and added multi-version docs by frgfm in https://github.com/frgfm/torch-scan/pull/47
* feat: Added FLOPS estimation support for nn.Transformer by frgfm in https://github.com/frgfm/torch-scan/pull/48
* refactor: Improved project code quality by frgfm in https://github.com/frgfm/torch-scan/pull/53
* refactor: Refactored setup and tool config into setup.cfg by frgfm in https://github.com/frgfm/torch-scan/pull/57
* style: Added black formatting & refactored configs into pyproject.toml by frgfm in https://github.com/frgfm/torch-scan/pull/58
* ci: Deprecates old requirements.txt by frgfm in https://github.com/frgfm/torch-scan/pull/59
* docs: Updated documentation theme and README by frgfm in https://github.com/frgfm/torch-scan/pull/61
* docs: Updated documentation theme by frgfm in https://github.com/frgfm/torch-scan/pull/62
* style: Updated mypy and isort configs by frgfm in https://github.com/frgfm/torch-scan/pull/66
* chore: Improved version specifiers and fixed conda recipe by frgfm in https://github.com/frgfm/torch-scan/pull/68
* ci: Updates the Python version of the CI & file headers by frgfm in https://github.com/frgfm/torch-scan/pull/69
* docs: Fixed README badge and updated documentation by frgfm in https://github.com/frgfm/torch-scan/pull/70
* docs: Improved documentation build script by frgfm in https://github.com/frgfm/torch-scan/pull/72
* style: Renamed variables to avoid built-in names by frgfm in https://github.com/frgfm/torch-scan/pull/73

New Contributors
* joonas-yoon made their first contribution in https://github.com/frgfm/torch-scan/pull/56

**Full Changelog**: https://github.com/frgfm/torch-scan/compare/v0.1.1...v0.1.2

0.1.1

This release adds support of more modules by the crawler and enables receptive field computation for highway nets.

**Note**: torchscan 0.1.1 requires PyTorch 1.1 or newer.

Highlights

Modules
In-hook information extraction for supported `torch.nn.Module`
**New**
- Add experimental support of receptive field estimation for the following `torch.nn.Module`: `Identity`, `Linear`, `Identity`, `ReLU`, `ELU`, `LeakyReLU`, `ReLU6`, `Tanh`, `Sigmoid`, `_ConvTransposeNd`, `_ConvNd`, `_BatchNorm`, `_MaxPoolNd`, `_AvgPoolNd`, `_AdaptiveMaxPoolNd`, `_AdaptiveAvgPoolNd`, `Dropout` (21).

**Fixes**
- Fixed transposed convolutions identification (14)
- Fixed flops, macs & dmas estimation for pooling operations (19, 20)

 Crawler
Module hooking agent
**New**
- Added an experimental feature `receptive_field` in the `summary` function (21)

Test
Verifications of the package well-being before release
**New**
- Updated test for `torchscan.modules` (21)

Documentation
Online resources for potential users
**Improvements**
- Add documentation website referencing (13)
- Updated documentation (22)

**Fixes**
- Fixed documentation deployment (16)

Others
Other tools and implementations
- Fixed the conda upload job (11, 23)

0.1.0

This release adds a module crawler to pick up relevant inference information.

**Note**: torchscan 0.1.0 requires PyTorch 1.1 or newer.

Highlights

Modules
In-hook information extraction for supported `torch.nn.Module`
**New**
- Add FLOPs, MACs and DMAs estimation support for the following `torch.nn.Module`: `Identity`, `Linear`, `Identity`, `ReLU`, `ELU`, `LeakyReLU`, `ReLU6`, `Tanh`, `Sigmoid`, `_ConvTransposeMixin`, `_ConvNd`, `_BatchNorm`, `_MaxPoolNd`, `_AvgPoolNd`, `_AdaptiveMaxPoolNd`, `_AdaptiveAvgPoolNd`, `Dropout` (1, 6, 7).

Process
Python process information related
**New**
- Add `get_process_gpu_ram` to retrieve GPU RAM usage of the current Python process (1).

 Crawler
Module hooking agent
**New**
- Add `crawl_module` to store all module information in a python `dict` (1, 6)
- Add `summary` for high-level console-printed information (1)

Test
Verifications of the package well-being before release
**New**
- Add test for `torchscan.modules` (1 , 6, 7)
- Add test for `torschscan.process` (1, 6)
- Add test for `torschscan.crawler` (6)
- Add test for `torschscan.utils` (1, 6)

Documentation
Online resources for potential users
**New**
- Add sphinx automatic documentation build for existing features (1)
- Add contribution guidelines (1)
- Add installation, usage, and benchmark in readme (1, 2, 8)

Others
Other tools and implementations
- Add ̀format_info` to generate a string output from the `crawl_module` returned dictionary (1).
- Add `aggregate_info` to aggregate `crawl_module` output to a specific depth (1).
- Add `scripts/benchmark.py` to display `crawl_module` information on all `torchvision` classification models (1 )


_Notes: upon the next `torch` release, `_ConvTransposeMixin` will be renamed to `_ConvTransposeNd`_

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.