$npx skillfedfor your agent

thop

A tool to count the FLOPs of PyTorch model.

With conditionsPyPI Artificial IntelligenceReleased Sep 20221.0M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — thop-0.1.1.post2209072238-py3-none-any.whl
v0.1.1.post2209072238 · released 2022-09-07 · 1 runtime deps: torch

Yes, if you are actively profiling torch models and can tolerate dormant maintenance. The package is stable for its narrow use case and has no known vulnerabilities, but verify compatibility with your torch version before relying on it in production. Consider alternatives if you need ongoing support or features for very recent model architectures.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires torch as a runtime dependency; model must be a valid PyTorch nn.Module.
  • Low friction installation via pip; dormant maintenance status with last commit in July 2024 and no releases since September 2022, though the repository remains active with 5079 stars.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal legal constraints.

last release 2022-09-07 (1437 days) · last repo commit 2024-07-08 · 5,079 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,035,556 downloads/mo, #4,462 on PyPI

Verify before relying

pip install thop

from thop import profile, clever_format
import torch

model = resnet50()
input_tensor = torch.randn(1, 3, 224, 224)
macs, params = profile(model, inputs=(input_tensor,))
macs, params = clever_format([macs, params], "%.3f")
  • Whether the package works correctly with recent PyTorch versions given the dormant maintenance status since September 2022.
  • Support for modern model architectures beyond those listed in the benchmark results.
  • Compatibility with Python versions beyond the unspecified support declaration.
Same gist for agents: .md · .json

What it is and what it does

THOP is a PyTorch profiling tool that measures the computational cost of neural network models by counting multiply-accumulate operations (MACs) and model parameters. It works by instrumenting torch models during a forward pass to track operations, then reporting aggregate statistics.

The package is designed for model developers and researchers who need to understand the computational footprint of their networks—useful when comparing architectures, optimizing for deployment, or working within compute budgets. It includes built-in counting rules for standard layers and allows custom counting logic for third-party modules. The `clever_format` utility provides readable output formatting.

Use it for

  • Compare computational complexity across different neural network architectures before training.
  • Profile existing models to identify bottlenecks and guide optimization efforts.
  • Estimate deployment feasibility by checking MACs and parameter counts against hardware constraints.
  • Benchmark model efficiency for resource-constrained deployment scenarios.
  • Validate custom layers by defining counting rules for non-standard torch modules.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are actively profiling torch models and can tolerate dormant maintenance.

The package is stable for its narrow use case and has no known vulnerabilities, but verify compatibility with your torch version before relying on it in production. Consider alternatives if you need ongoing support or features for very recent model architectures.

Install

thop on PyPI

Before you install

Low friction installation via pip; dormant maintenance status with last commit in July 2024 and no releases since September 2022, though the repository remains active with 5079 stars.

Requires torch as a runtime dependency; model must be a valid PyTorch nn.Module.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal legal constraints.

Quickstart

pip install thop

from thop import profile, clever_format
import torch

model = resnet50()
input_tensor = torch.randn(1, 3, 224, 224)
macs, params = profile(model, inputs=(input_tensor,))
macs, params = clever_format([macs, params], "%.3f")

Verify before relying

  • Whether the package works correctly with recent PyTorch versions given the dormant maintenance status since September 2022.
  • Support for modern model architectures beyond those listed in the benchmark results.
  • Compatibility with Python versions beyond the unspecified support declaration.

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
torch
MaintenanceDormant 1,437 days since the last release
Last repo commit
First released
Downloads1,035,556 / month, #4,462 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Programming Language :: Python :: 3

Evidence: thop-0.1.1.post2209072238-py3-none-any.whl

Tags

Capabilities
pytorch flop countermodel complexity analysisneural network profilingpytorch operation countercompute cost estimationmodel parameter countingpytorch mac counter
Topics
model-profilingpytorch-tools

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pytorch flop counter”

  • thopCounts floating-point operations (MACs) and parameters in PyTorch…
  • torchprofileCounts multiply-accumulate operations (MACs) in PyTorch models by…
  • fvcorefvcore provides shared computer vision utilities for PyTorch,…

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also ultralytics-thop · torchprofile · torchsummary · opt-einsum-fx · torch-tb-profiler · timm · retinaface-py · pretrainedmodels · pnnx · pygount