There exists a commented section in tfmot for QAT of RNN layers.

class Default8BitQuantizeRegistry
Line : 170.

The implementation seems semi-developed.
I want to extend this and make it work for LSTMs. However, I am not sure where and how to start.
I would really appreciate any starting points on the same.

Thanks a lot in advance.


Thank you for showing interest to contribute. Before you contribute source code to a TensorFlow project, please review the file in the GitHub repo of the project. All code contributors are required to sign a Contributor License Agreement (CLA).

Contribution workflow

Code contributions—bug fixes, new development, test improvement—all follow a GitHub-centered workflow. To participate in TensorFlow development, set up a GitHub account. Then:

  1. Fork the repo you plan to work on. Go to the project repo page and use the Fork button. This will create a copy of the repo, under your username. (For more details on how to fork a repository see this guide.)
  2. Clone down the repo to your local system.$ git clone
  3. Create a new branch to hold your work.$ git checkout -b new-branch-name
  4. Work on your new code. Write and run tests.
  5. Commit your changes.$ git add -A``$ git commit -m "commit message here"
  6. Push your changes to your GitHub repo.$ git push origin branch-name
  7. Open a Pull Request (PR). Go to the original project repo on GitHub. There will be a message about your recently pushed branch, asking if you would like to open a pull request. Follow the prompts, compare across repositories, and submit the PR. This will send an email to the committers. You may want to consider sending an email to the mailing list for more visibility. (For more details, see the GitHub guide on PRs.
  8. Maintainers and other contributors will review your PR. Please participate in the conversation, and try to make any requested changes. Once the PR is approved, the code will be merged.

For more details please refer to Contribute to the TensorFlow code