types-tensorflow
Typing stubs for tensorflow
Decision gist · record as of 2026-08-14
Yes, if you use a static type checker with TensorFlow code. Install it as a dev dependency to enable type validation and IDE support. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe choice. Be aware it is a partial stub package—some annotations may be missing, and it targets TensorFlow 2.18.0 specifically.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Intended for use with a type checker (mypy, pyright, or ty); does not provide runtime functionality.
- Low install friction with stable maintenance.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows use in most projects without restriction, including commercial and proprietary software.
last release 2026-07-30 (15 days) · last repo commit 2026-08-14 · 37 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 407,574 downloads/mo, #6,886 on PyPI
Alternatives
Verify before relying
pip install types-tensorflow
import tensorflow as tf
# Type checkers now understand tensorflow's API- Coverage completeness: the package is marked as partial; extent of missing annotations for TensorFlow 2.18.0 is not specified.
- Compatibility with TensorFlow versions beyond 2.18.0 or with older versions is not documented in the excerpt.
What it is and what it does
types-tensorflow is a type stub package that provides type annotations for TensorFlow 2.18.0. It allows static type checkers like mypy, pyright, and ty to understand and validate TensorFlow code without requiring TensorFlow itself to be installed during type checking. The stubs are partially generated from TensorFlow's protobuf definitions using mypy-protobuf and tested against multiple type checkers.
The package is part of the typeshed project and marked as partial, meaning some annotations may be incomplete. It depends on numpy, types-protobuf, and requests—lightweight dependencies that support the type information layer. Use it when you want IDE autocompletion and static type validation for TensorFlow code in your editor or CI pipeline.
Use it for
- Enable mypy or pyright to type-check TensorFlow code in CI/CD without installing the full TensorFlow package.
- Get IDE autocompletion and hover documentation for TensorFlow APIs in editors that support type stubs.
- Validate TensorFlow function signatures and argument types during development without runtime overhead.
- Support type-aware refactoring tools that rely on accurate type information for TensorFlow modules.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use a static type checker with TensorFlow code.
Install it as a dev dependency to enable type validation and IDE support. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a safe choice. Be aware it is a partial stub package—some annotations may be missing, and it targets TensorFlow 2.18.0 specifically.
Install
types-tensorflow on PyPI
Before you install
Low install friction with stable maintenance. Released 15 days ago with active repository status. Depends on numpy, types-protobuf, and requests—all common, well-maintained packages.
Requires Python 3.10 or later. Intended for use with a type checker (mypy, pyright, or ty); does not provide runtime functionality.
License in practice
Apache-2.0 permissive license allows use in most projects without restriction, including commercial and proprietary software.
Quickstart
pip install types-tensorflow
import tensorflow as tf
# Type checkers now understand tensorflow's API
Verify before relying
- Coverage completeness: the package is marked as partial; extent of missing annotations for TensorFlow 2.18.0 is not specified.
- Compatibility with TensorFlow versions beyond 2.18.0 or with older versions is not documented in the excerpt.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesnumpytypes-protobufrequests |
| Maintenance | Actively maintained 15 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 407,574 / month, #6,886 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Typing :: Stubs Only |
Evidence: types_tensorflow-2.18.0.20260730-py3-none-any.whl
Tags
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 › “tensorflow type stubs”
- types-tensorflowProvides type hints for TensorFlow 2.18.0, enabling static type…
- thincThinc is a lightweight deep learning library offering a…
- etilsA modular collection of utility submodules for Python, each…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also types-Pygments · types-docker · types-protobuf · types-yt-dlp · types-pyinstaller · types-django-filter · types-grpcio · types-networkx · types-pynput · types-hvac