{"id":13471648,"url":"https://github.com/tensorflow/addons","last_synced_at":"2025-05-14T02:04:51.928Z","repository":{"id":38819372,"uuid":"159249114","full_name":"tensorflow/addons","owner":"tensorflow","description":"Useful extra functionality for TensorFlow 2.x maintained by SIG-addons","archived":false,"fork":false,"pushed_at":"2025-03-26T21:42:40.000Z","size":6189,"stargazers_count":1698,"open_issues_count":97,"forks_count":614,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-05-13T14:19:39.876Z","etag":null,"topics":["deep-learning","machine-learning","neural-network","python","tensorflow","tensorflow-addons"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tensorflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-26T23:57:17.000Z","updated_at":"2025-05-03T01:06:22.000Z","dependencies_parsed_at":"2023-02-16T20:01:06.972Z","dependency_job_id":"ebf251d4-b9df-4016-bfb8-afc892645789","html_url":"https://github.com/tensorflow/addons","commit_stats":{"total_commits":1510,"total_committers":216,"mean_commits":"6.9907407407407405","dds":0.795364238410596,"last_synced_commit":"d208d752e98c310280938efa939117bf635a60a8"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Faddons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Faddons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Faddons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tensorflow%2Faddons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tensorflow","download_url":"https://codeload.github.com/tensorflow/addons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052670,"owners_count":22006716,"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":["deep-learning","machine-learning","neural-network","python","tensorflow","tensorflow-addons"],"created_at":"2024-07-31T16:00:47.809Z","updated_at":"2025-05-14T02:04:51.851Z","avatar_url":"https://github.com/tensorflow.png","language":"Python","readme":"\n\u003ch2 align=\"center\"\u003e\n :warning: :warning: :warning:\n\u003c/h2\u003e\n\n\u003ch4 align=\"center\"\u003e\nTensorFlow Addons (TFA) has ended development and introduction of new features.\n\nTFA has entered a minimal maintenance and release mode until a planned end of life \nin May 2024. Please modify downstream libraries to take dependencies from other \nrepositories in our TensorFlow community (e.g. Keras, Keras-CV, and Keras-NLP)\n\nFor more information see: [https://github.com/tensorflow/addons/issues/2807](https://github.com/tensorflow/addons/issues/2807)\n\u003c/h4\u003e\n\n-----------------\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/tensorflow/community/blob/master/sigs/logos/SIGAddons.png\" width=\"60%\"\u003e\u003cbr\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n-----------------\n\n[![PyPI Status Badge](https://badge.fury.io/py/tensorflow-addons.svg)](https://pypi.org/project/tensorflow-addons/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tensorflow-addons)](https://pypi.org/project/tensorflow-addons/)\n[![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://www.tensorflow.org/addons/api_docs/python/tfa)\n[![Gitter chat](https://img.shields.io/badge/chat-on%20gitter-46bc99.svg)](https://gitter.im/tensorflow/sig-addons)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n### Continuous Build Status\n\n| Build      | Status |\n| ---             | ---    |\n| **Ubuntu/macOS**   | [![Status](https://github.com/tensorflow/addons/actions/workflows/release.yml/badge.svg)](https://github.com/tensorflow/addons/actions?query=workflow%3Aaddons-release) |\n| **Ubuntu GPU custom ops**   | [![Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/addons/ubuntu-gpu-py3.svg)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/addons/ubuntu-gpu-py3.html) |\n\n**TensorFlow Addons** is a repository of contributions that conform to\nwell-established API patterns, but implement new functionality\nnot available in core TensorFlow. TensorFlow natively supports\na large number of operators, layers, metrics, losses, and optimizers.\nHowever, in a fast moving field like ML, there are many interesting new\ndevelopments that cannot be integrated into core TensorFlow\n(because their broad applicability is not yet clear, or it is mostly\n used by a smaller subset of the community).\n\n## Addons Subpackages\n\n* [tfa.activations](https://www.tensorflow.org/addons/api_docs/python/tfa/activations) \n* [tfa.callbacks](https://www.tensorflow.org/addons/api_docs/python/tfa/callbacks) \n* [tfa.image](https://www.tensorflow.org/addons/api_docs/python/tfa/image) \n* [tfa.layers](https://www.tensorflow.org/addons/api_docs/python/tfa/layers)\n* [tfa.losses](https://www.tensorflow.org/addons/api_docs/python/tfa/losses)\n* [tfa.metrics](https://www.tensorflow.org/addons/api_docs/python/tfa/metrics) \n* [tfa.optimizers](https://www.tensorflow.org/addons/api_docs/python/tfa/optimizers) \n* [tfa.rnn](https://www.tensorflow.org/addons/api_docs/python/tfa/rnn) \n* [tfa.seq2seq](https://www.tensorflow.org/addons/api_docs/python/tfa/seq2seq) \n* [tfa.text](https://www.tensorflow.org/addons/api_docs/python/tfa/text) \n\n## Maintainership\nThe maintainers of TensorFlow Addons can be found in the [CODEOWNERS](.github/CODEOWNERS) file of the repo. This file \nis parsed and pull requests will automatically tag the owners using a bot. If you would\nlike to maintain something, please feel free to submit a PR. We encourage multiple \nowners for all submodules.\n\n## Installation\n#### Stable Builds\nTensorFlow Addons is available on PyPI for Linux \u0026 macOS (Windows support was dropped \ndue to [inconsistent TF2.15 whl packaging](https://github.com/tensorflow/tensorflow/issues/61830)). To install the latest version, \nrun the following:\n```\npip install tensorflow-addons\n```\n\nTo ensure you have a version of TensorFlow that is compatible with TensorFlow Addons, \nyou can specify the `tensorflow` extra requirement during install:\n\n```\npip install tensorflow-addons[tensorflow]\n```\n\nSimilar extras exist for the `tensorflow-gpu` and `tensorflow-cpu` packages.\n \n\nTo use TensorFlow Addons:\n\n```python\nimport tensorflow as tf\nimport tensorflow_addons as tfa\n```\n\n### Python Op Compatility\nTensorFlow Addons is actively working towards forward compatibility with TensorFlow 2.x. \nHowever, there are still a few private API uses within the repository so at the moment \nwe can only guarantee compatibility with the TensorFlow versions which it was tested against. \nWarnings will be emitted when importing `tensorflow_addons` if your TensorFlow version does not match \nwhat it was tested against.\n\n#### Python Op Compatibility Matrix\n| TensorFlow Addons | TensorFlow | Python  |\n|:----------------------- |:---|:---------- |\n| tfa-nightly | 2.12, 2.13, 2.14 |3.9, 3.10, 3.11 |\n| tensorflow-addons-0.22.0 | 2.12, 2.13, 2.14 |3.9, 3.10, 3.11 |\n| tensorflow-addons-0.21.0 | 2.11, 2.12, 2.13 |3.8, 3.9, 3.10, 3.11 |\n| tensorflow-addons-0.20.0 | 2.10, 2.11, 2.12 |3.8, 3.9, 3.10, 3.11 |\n| tensorflow-addons-0.19.0 | 2.9, 2.10, 2.11 |3.7, 3.8, 3.9, 3.10 |\n| tensorflow-addons-0.18.0 | 2.8, 2.9, 2.10 |3.7, 3.8, 3.9, 3.10 |\n| tensorflow-addons-0.17.1 | 2.7, 2.8, 2.9 |3.7, 3.8, 3.9, 3.10 |\n| tensorflow-addons-0.16.1 | 2.6, 2.7, 2.8 |3.7, 3.8, 3.9, 3.10 |\n| tensorflow-addons-0.15.0 | 2.5, 2.6, 2.7 |3.7, 3.8, 3.9 |\n| tensorflow-addons-0.14.0 | 2.4, 2.5, 2.6 |3.6, 3.7, 3.8, 3.9 |\n| tensorflow-addons-0.13.0 | 2.3, 2.4, 2.5 |3.6, 3.7, 3.8, 3.9 |\n| tensorflow-addons-0.12.1 | 2.3, 2.4 |3.6, 3.7, 3.8 |\n| tensorflow-addons-0.11.2 | 2.2, 2.3 |3.5, 3.6, 3.7, 3.8 |\n| tensorflow-addons-0.10.0 | 2.2 |3.5, 3.6, 3.7, 3.8 |\n| tensorflow-addons-0.9.1 | 2.1, 2.2 |3.5, 3.6, 3.7 |\n| tensorflow-addons-0.8.3 | 2.1 |3.5, 3.6, 3.7 |\n| tensorflow-addons-0.7.1 | 2.1 | 2.7, 3.5, 3.6, 3.7 | \n| tensorflow-addons-0.6.0 | 2.0 | 2.7, 3.5, 3.6, 3.7 |\n\n### C++ Custom Op Compatibility\nTensorFlow C++ APIs are not stable and thus we can only guarantee compatibility with the \nversion TensorFlow Addons was built against. It is possible custom ops will work with multiple \nversions of TensorFlow, but there is also a chance for segmentation faults or other problematic crashes.\nWarnings will be emitted when loading a custom op if your TensorFlow version does not match \nwhat it was built against.\n\nAdditionally, custom ops registration does not have a stable ABI interface so it is \nrequired that users have a compatible installation of TensorFlow even if the versions \nmatch what we had built against. A simplification of this is that **TensorFlow Addons \ncustom ops will work with `pip`-installed TensorFlow** but will have issues when TensorFlow \nis compiled differently. A typical example of this would be `conda`-installed TensorFlow.\n[RFC #133](https://github.com/tensorflow/community/pull/133) aims to fix this.\n\n\n#### C++ Custom Op Compatibility Matrix\n| TensorFlow Addons | TensorFlow | Compiler  | cuDNN | CUDA | \n|:----------------------- |:---- |:---------|:---------|:---------|\n| tfa-nightly | 2.14  | GCC 9.3.1 | 8.6 | 11.8 |\n| tensorflow-addons-0.22.0 | 2.14  | GCC 9.3.1 | 8.6 | 11.8 |\n| tensorflow-addons-0.21.0 | 2.13  | GCC 9.3.1 | 8.6 | 11.8 |\n| tensorflow-addons-0.20.0 | 2.12  | GCC 9.3.1 | 8.6 | 11.8 |\n| tensorflow-addons-0.19.0 | 2.11  | GCC 9.3.1 | 8.1 | 11.2 |\n| tensorflow-addons-0.18.0 | 2.10  | GCC 9.3.1 | 8.1 | 11.2 |\n| tensorflow-addons-0.17.1 | 2.9  | GCC 9.3.1 | 8.1 | 11.2 |\n| tensorflow-addons-0.16.1 | 2.8  | GCC 7.3.1 | 8.1 | 11.2 |\n| tensorflow-addons-0.15.0 | 2.7  | GCC 7.3.1 | 8.1 | 11.2 |\n| tensorflow-addons-0.14.0 | 2.6  | GCC 7.3.1 | 8.1 | 11.2 |\n| tensorflow-addons-0.13.0 | 2.5  | GCC 7.3.1 | 8.1 | 11.2 |\n| tensorflow-addons-0.12.1 | 2.4  | GCC 7.3.1 | 8.0 | 11.0 |\n| tensorflow-addons-0.11.2 | 2.3  | GCC 7.3.1 | 7.6 | 10.1 |\n| tensorflow-addons-0.10.0 | 2.2  | GCC 7.3.1 | 7.6 | 10.1 |\n| tensorflow-addons-0.9.1 | 2.1  | GCC 7.3.1 | 7.6 | 10.1 |\n| tensorflow-addons-0.8.3 | 2.1  | GCC 7.3.1 | 7.6 | 10.1 |\n| tensorflow-addons-0.7.1 | 2.1  | GCC 7.3.1 | 7.6 | 10.1 |\n| tensorflow-addons-0.6.0 | 2.0  | GCC 7.3.1 | 7.4 | 10.0 |\n\n\n#### Nightly Builds\nThere are also nightly builds of TensorFlow Addons under the pip package\n`tfa-nightly`, which is built against **the latest stable version of TensorFlow**. Nightly builds\ninclude newer features, but may be less stable than the versioned releases. Contrary to \nwhat the name implies, nightly builds are not released every night, but at every commit \nof the master branch. `0.9.0.dev20200306094440` means that the commit time was \n2020/03/06 at 09:44:40 Coordinated Universal Time.\n\n```\npip install tfa-nightly\n```\n\n#### Installing from Source\nYou can also install from source. This requires the [Bazel](\nhttps://bazel.build/) build system (version \u003e= 1.0.0).\n\n##### CPU Custom Ops\n```\ngit clone https://github.com/tensorflow/addons.git\ncd addons\n\n# This script links project with TensorFlow dependency\npython3 ./configure.py\n\nbazel build build_pip_pkg\nbazel-bin/build_pip_pkg artifacts\n\npip install artifacts/tensorflow_addons-*.whl\n```\n\n##### GPU and CPU Custom Ops\n```\ngit clone https://github.com/tensorflow/addons.git\ncd addons\n\nexport TF_NEED_CUDA=\"1\"\n\n# Set these if the below defaults are different on your system\nexport TF_CUDA_VERSION=\"12\"\nexport TF_CUDNN_VERSION=\"8\"\nexport CUDA_TOOLKIT_PATH=\"/usr/local/cuda\"\nexport CUDNN_INSTALL_PATH=\"/usr/lib/x86_64-linux-gnu\"\n\n# This script links project with TensorFlow dependency\npython3 ./configure.py\n\nbazel build build_pip_pkg\nbazel-bin/build_pip_pkg artifacts\n\npip install artifacts/tensorflow_addons-*.whl\n```\n\n## Tutorials\nSee [`docs/tutorials/`](docs/tutorials/)\nfor end-to-end examples of various addons.\n\n## Core Concepts\n\n#### Standardized API within Subpackages\nUser experience and project maintainability are core concepts in\nTensorFlow Addons. In order to achieve these we require that our additions\nconform to established API patterns seen in core TensorFlow.\n\n#### GPU and CPU Custom Ops\nTensorFlow Addons supports precompiled custom ops for CPU and GPU. However, \nGPU custom ops currently only work on Linux distributions. For this reason Windows and macOS \nwill fallback to pure TensorFlow Python implementations whenever possible.\n\nThe order of priority on macOS/Windows is:\n1) Pure TensorFlow + Python implementation (works on CPU and GPU)\n2) C++ implementation for CPU\n\nThe order of priority on Linux is:\n1) CUDA implementation\n2) C++ implementation\n3) Pure TensorFlow + Python implementation (works on CPU and GPU)\n\nIf you want to change the default priority, \"C++ and CUDA\" VS \"pure TensorFlow Python\",\nyou can set the environment variable `TF_ADDONS_PY_OPS=1` from the command line or\nrun `tfa.options.disable_custom_kernel()` in your code.\n\nFor example, if you are on Linux and you have compatibility problems with the compiled ops,\nyou can give priority to the Python implementations:\n\nFrom the command line:\n```bash\nexport TF_ADDONS_PY_OPS=1\n```\n\nor in your code:\n\n```python\nimport tensorflow_addons as tfa\ntfa.options.disable_custom_kernel()\n```\n\nThis variable defaults to `True` on Windows and macOS, and `False` on Linux.\n\n#### Proxy Maintainership\nTensorFlow Addons has been designed to compartmentalize submodules so \nthat they can be maintained by community users who have expertise, and a vested \ninterest in that component. We heavily encourage users to submit sign up to maintain a \nsubmodule by submitting your username to the [CODEOWNERS](.github/CODEOWNERS) file.\n\nFull write access will only be granted after substantial contribution \nhas been made in order to limit the number of users with write permission. \nContributions can come in the form of issue closings, bug fixes, documentation, \nnew code, or optimizing existing code. Submodule maintainership can be granted \nwith a lower barrier for entry as this will not include write permissions to \nthe repo.\n\nFor more information see [the RFC](https://github.com/tensorflow/community/blob/master/rfcs/20190308-addons-proxy-maintainership.md) \non this topic.\n\n#### Periodic Evaluation of Subpackages\nGiven the nature of this repository, submodules may become less \nand less useful to the community as time goes on. In order to keep the \nrepository sustainable, we'll be performing bi-annual reviews of our code to \nensure everything still belongs within the repo. Contributing factors to this \nreview will be:\n\n1. Number of active maintainers\n2. Amount of OSS use\n3. Amount of issues or bugs attributed to the code\n4. If a better solution is now available\n\nFunctionality within TensorFlow Addons can be categorized into three groups:\n\n* **Suggested**: well-maintained API; use is encouraged.\n* **Discouraged**: a better alternative is available; the API is kept for \nhistoric reasons; or the API requires maintenance and is the waiting period \nto be deprecated.\n* **Deprecated**: use at your own risk; subject to be deleted.\n\nThe status change between these three groups is: \nSuggested \u003c-\u003e Discouraged -\u003e Deprecated.\n\nThe period between an API being marked as deprecated and being deleted will be \n90 days. The rationale being:\n\n1. In the event that TensorFlow Addons releases monthly, there will be 2-3 \nreleases before an API is deleted. The release notes could give user enough \nwarning.\n\n2. 90 days gives maintainers ample time to fix their code.\n\n\n## Contributing\nTensorFlow Addons is a community-led open source project (only a few maintainers work for Google!). \nAs such, the project depends on public contributions, bug fixes, and documentation. \nThis project adheres to [TensorFlow's code of conduct](CODE_OF_CONDUCT.md).\nBy participating, you are expected to uphold this code.\n\nDo you want to contribute but are not sure of what? Here are a few suggestions:\n1. Add a new tutorial. Located in [`docs/tutorials/`](docs/tutorials),\n  these are a great way to familiarize yourself and others with TensorFlow Addons. See\n  [the guidelines](docs/tutorials/README.md) for more information on how to add\n  examples.\n2. Improve the docstrings. The docstrings are fetched and then displayed in the documentation.\n  Do a change and hundreds of developers will see it and benefit from it. Maintainers are often focused \n  on making APIs, fixing bugs and other code related changes. The documentation will never \n  be loved enough!\n3. Solve an [existing issue](https://github.com/tensorflow/addons/issues).\n  These range from low-level software bugs to higher-level design problems.\n  Check out the label [help wanted](https://github.com/tensorflow/addons/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). If you're a new contributor, the label [good first issue](https://github.com/tensorflow/addons/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) can be a good place to start.\n4. Review a pull request. So you're not a software engineer but you know a lot\n  about a certain field a research? That's awesome and we need your help! Many people \n  are submitting pull requests to add layers/optimizers/functions taken from recent\n  papers. Since TensorFlow Addons maintainers are not specialized in everything,\n  you can imagine how hard it is to review. It takes very long to read the paper,\n  understand it and check the math in the pull request. If you're specialized, look at \n  the [list of pull requests](https://github.com/tensorflow/addons/pulls). \n  If there is something from a paper you know, please comment on the pull request to\n  check the math is ok. If you see that everything is good, say it! It will help \n  the maintainers to sleep better at night knowing that he/she wasn't the only\n  person to approve the pull request.\n5. You have an opinion and want to share it? The docs are not very helpful for \n  a function or a class? You tried to open a pull request but you didn't manage to \n  install or test anything and you think it's too complicated? You made a pull request\n  but you didn't find the process good enough and it made no sense to you? Please \n  say it! We want feedback. Maintainers are too much the head into the code \n  to understand what it's like for someone new to open source to come to this project. \n  If you don't understand something, be aware there are no people who are \n  bad at understanding, there are just bad tutorials and bad guides.\n\nPlease see [contribution guidelines](CONTRIBUTING.md) to get started (and remember,\nif you don't understand something, open an issue, or even make a pull request to \nimprove the guide!).\n\n## Community\n* [Public Mailing List](https://groups.google.com/a/tensorflow.org/forum/#!forum/addons)\n* [SIG Monthly Meeting Notes](https://docs.google.com/document/d/1kxg5xIHWLY7EMdOJCdSGgaPu27a9YKpupUz2VTXqTJg)\n    * Join our mailing list and receive calendar invites to the meeting\n\n## License\n[Apache License 2.0](LICENSE)\n\n","funding_links":[],"categories":["其他_机器学习与深度学习","Deep Learning Framework","TensorFlow Tools, Libraries, and Frameworks","Tensorflow实用程序","Python","Other 💛💛💛💛💛\u003ca name=\"Other\" /\u003e"],"sub_categories":["High-Level DL APIs","强大的扩展"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftensorflow%2Faddons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftensorflow%2Faddons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftensorflow%2Faddons/lists"}