{"id":26087857,"url":"https://github.com/zhijian-liu/torchprofile","last_synced_at":"2025-05-15T13:07:45.423Z","repository":{"id":48181951,"uuid":"205957008","full_name":"zhijian-liu/torchprofile","owner":"zhijian-liu","description":"A general and accurate MACs / FLOPs profiler for PyTorch models","archived":false,"fork":false,"pushed_at":"2024-05-05T00:01:21.000Z","size":81,"stargazers_count":603,"open_issues_count":7,"forks_count":42,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-13T14:09:14.042Z","etag":null,"topics":["profiler","pytorch"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/torchprofile/","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/zhijian-liu.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":"2019-09-03T00:30:33.000Z","updated_at":"2025-04-01T07:06:38.000Z","dependencies_parsed_at":"2022-09-04T05:23:09.912Z","dependency_job_id":"14f64f0f-20ce-4ca5-bd6c-daeaddadfa42","html_url":"https://github.com/zhijian-liu/torchprofile","commit_stats":{"total_commits":131,"total_committers":5,"mean_commits":26.2,"dds":0.03053435114503822,"last_synced_commit":"6d80fe57bb8c6bc9f789da7925fac6547fa9502b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhijian-liu%2Ftorchprofile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhijian-liu%2Ftorchprofile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhijian-liu%2Ftorchprofile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhijian-liu%2Ftorchprofile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhijian-liu","download_url":"https://codeload.github.com/zhijian-liu/torchprofile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["profiler","pytorch"],"created_at":"2025-03-09T07:58:10.953Z","updated_at":"2025-05-15T13:07:45.344Z","avatar_url":"https://github.com/zhijian-liu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Torchprofile\n\nThis is a profiler to count the number of MACs / FLOPs of PyTorch models based on `torch.jit.trace`.\n* It is more **general** than ONNX-based profilers as some operations in PyTorch are not supported by ONNX for now.\n* It is more **accurate** than hook-based profilers as they cannot profile operations within `torch.nn.Module`.\n\n## Installation\n\n\n```bash\npip install torchprofile\n```\n\n## Getting Started\n\nYou should first define your PyTorch model and its (dummy) input:\n\n```python\nimport torch\nfrom torchvision.models import resnet18\n\nmodel = resnet18()\ninputs = torch.randn(1, 3, 224, 224)\n```\n\nYou can then measure the number of MACs using `profile_macs`:\n\n```python\nfrom torchprofile import profile_macs\n\nmacs = profile_macs(model, inputs)\n```\n\n## License\n\nThis repository is released under the MIT license. See [LICENSE](LICENSE) for additional details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhijian-liu%2Ftorchprofile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhijian-liu%2Ftorchprofile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhijian-liu%2Ftorchprofile/lists"}