{"id":14958174,"url":"https://github.com/swall0w/torchstat","last_synced_at":"2026-10-19T12:43:23.825Z","repository":{"id":38348442,"uuid":"154848329","full_name":"Swall0w/torchstat","owner":"Swall0w","description":"Model analyzer in PyTorch","archived":false,"fork":false,"pushed_at":"2023-03-19T03:13:59.000Z","size":48,"stargazers_count":1501,"open_issues_count":45,"forks_count":139,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-10-15T12:26:15.208Z","etag":null,"topics":["python","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Swall0w.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-26T14:36:14.000Z","updated_at":"2026-10-01T16:54:50.000Z","dependencies_parsed_at":"2024-06-18T15:25:56.704Z","dependency_job_id":null,"html_url":"https://github.com/Swall0w/torchstat","commit_stats":{"total_commits":31,"total_committers":2,"mean_commits":15.5,"dds":"0.12903225806451613","last_synced_commit":"b52a3b06c2c54c2d09ade1a18cf6c4ca5dc27510"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Swall0w/torchstat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swall0w%2Ftorchstat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swall0w%2Ftorchstat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swall0w%2Ftorchstat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swall0w%2Ftorchstat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Swall0w","download_url":"https://codeload.github.com/Swall0w/torchstat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swall0w%2Ftorchstat/sbom","scorecard":{"id":136138,"data":{"date":"2025-08-11","repo":{"name":"github.com/Swall0w/torchstat","commit":"b52a3b06c2c54c2d09ade1a18cf6c4ca5dc27510"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"16 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: PYSEC-2020-73","Warn: Project is vulnerable to: GHSA-3749-ghw9-m3mg","Warn: Project is vulnerable to: PYSEC-2022-43015 / GHSA-47fc-vmwq-366v","Warn: Project is vulnerable to: PYSEC-2025-41 / GHSA-53q9-r3pm-6pq6","Warn: Project is vulnerable to: PYSEC-2024-252 / GHSA-5pcm-hx3q-hm94","Warn: Project is vulnerable to: GHSA-887c-mr87-cxwp","Warn: Project is vulnerable to: PYSEC-2024-251 / GHSA-pg7h-5qx3-wjr3","Warn: Project is vulnerable to: PYSEC-2024-250","Warn: Project is vulnerable to: PYSEC-2024-259"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T06:35:37.273Z","repository_id":38348442,"created_at":"2025-08-16T06:35:37.273Z","updated_at":"2025-08-16T06:35:37.273Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38356472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","pytorch"],"created_at":"2024-09-24T13:16:24.918Z","updated_at":"2026-10-19T12:43:23.532Z","avatar_url":"https://github.com/Swall0w.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/Swall0w/torchstat.svg?branch=master)](https://travis-ci.org/Swall0w/torchstat)\n\n# torchstat\nThis is a lightweight neural network analyzer based on PyTorch.\nIt is designed to make building your networks quick and easy, with the ability to debug them.\n**Note**: This repository is currently under development. Therefore, some APIs might be changed.\n\nThis tools can show\n\n* Total number of network parameters\n* Theoretical amount of floating point arithmetics (FLOPs)\n* Theoretical amount of multiply-adds (MAdd)\n* Memory usage\n\n## Installing\nThere're two ways to install torchstat into your environment.\n* Install it via pip.\n```bash\n$ pip install torchstat\n```\n\n* Install and update using **setup.py** after cloning this repository.\n```bash\n$ python3 setup.py install\n```\n\n## A Simple Example\nIf you want to run the torchstat asap, you can call it as a CLI tool if your network exists in a script.\nOtherwise you need to import torchstat as a module.\n\n### CLI tool\n```bash\n$ torchstat masato$ torchstat -f example.py -m Net\n[MAdd]: Dropout2d is not supported!\n[Flops]: Dropout2d is not supported!\n[Memory]: Dropout2d is not supported!\n      module name  input shape output shape     params memory(MB)           MAdd         Flops  MemRead(B)  MemWrite(B) duration[%]   MemR+W(B)\n0           conv1    3 224 224   10 220 220      760.0       1.85   72,600,000.0  36,784,000.0    605152.0    1936000.0      57.49%   2541152.0\n1           conv2   10 110 110   20 106 106     5020.0       0.86  112,360,000.0  56,404,720.0    504080.0     898880.0      26.62%   1402960.0\n2      conv2_drop   20 106 106   20 106 106        0.0       0.86            0.0           0.0         0.0          0.0       4.09%         0.0\n3             fc1        56180           50  2809050.0       0.00    5,617,950.0   2,809,000.0  11460920.0        200.0      11.58%  11461120.0\n4             fc2           50           10      510.0       0.00          990.0         500.0      2240.0         40.0       0.22%      2280.0\ntotal                                        2815340.0       3.56  190,578,940.0  95,998,220.0      2240.0         40.0     100.00%  15407512.0\n===============================================================================================================================================\nTotal params: 2,815,340\n-----------------------------------------------------------------------------------------------------------------------------------------------\nTotal memory: 3.56MB\nTotal MAdd: 190.58MMAdd\nTotal Flops: 96.0MFlops\nTotal MemR+W: 14.69MB\n```\n\nIf you're not sure how to use a specific command, run the command with the -h or –help switches.\nYou'll see usage information and a list of options you can use with the command.\n\n### Module\n```python\nfrom torchstat import stat\nimport torchvision.models as models\n\nmodel = models.resnet18()\nstat(model, (3, 224, 224))\n```\n\n## Features \u0026 TODO\n**Note**: These features work only nn.Module. Modules in torch.nn.functional are not supported yet.\n- [x] FLOPs\n- [x] Number of Parameters\n- [x] Total memory\n- [x] Madd(FMA)\n- [x] MemRead\n- [x] MemWrite\n- [ ] Model summary(detail, layer-wise)\n- [ ] Export score table\n- [ ] Arbitrary input shape\n\nFor the supported layers, check out [the details](./detail.md).\n\n\n## Requirements\n* Python 3.6+\n* Pytorch 0.4.0+\n* Pandas 0.23.4+\n* NumPy 1.14.3+\n\n## References\nThanks to @sovrasov for the initial version of flops computation, @ceykmc for the backbone of scripts.\n* [flops-counter.pytorch](https://github.com/sovrasov/flops-counter.pytorch)\n* [pytorch_model_summary](https://github.com/ceykmc/pytorch_model_summary)\n* [chainer_computational_cost](https://github.com/belltailjp/chainer_computational_cost)\n* [convnet-burden](https://github.com/albanie/convnet-burden).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswall0w%2Ftorchstat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswall0w%2Ftorchstat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswall0w%2Ftorchstat/lists"}