TensorLayer 2.0 is a major ongoing research project in CFCS, Peking University, the first version was established at Imperial College London in 2016. The goal of the project is to develop a compositional language while complex learning systems can be built through composition of neural network modules.

Numerous contributors come from various horizons such as: Imperial College London, Tsinghua University, Carnegie Mellon University, Stanford, University of Technology of Compiegne, Google, Microsoft, Bloomberg and etc.

You can easily open a Pull Request (PR) on GitHub, every little step counts and will be credited. As an open-source project, we highly welcome and value contributions!

If you are interested in working with us, please contact us at:


Project Maintainers

The TensorLayer project was started by Hao Dong at Imperial College London in June 2016.

For TensorLayer 2.x, it is now actively developing and maintaining by the following people who has more than 50 contributions:

For TensorLayer 1.x, it was actively developed and maintained by the following people (in alphabetical order):

Numerous other contributors can be found in the Github Contribution Graph.

What to contribute

Your method and example

If you have a new method or example in terms of Deep learning or Reinforcement learning, you are welcome to contribute.

  • Provide your layers or examples, so everyone can use it.

  • Explain how it would work, and link to a scientific paper if applicable.

  • Keep the scope as narrow as possible, to make it easier to implement.

Report bugs

Report bugs at the GitHub, we normally will fix it in 5 hours. If you are reporting a bug, please include:

  • your TensorLayer, TensorFlow and Python version.

  • steps to reproduce the bug, ideally reduced to a few Python commands.

  • the results you obtain, and the results you expected instead.

If you are unsure whether the behavior you experience is a bug, or if you are unsure whether it is related to TensorLayer or TensorFlow, please just ask on our mailing list first.

Fix bugs

Look through the GitHub issues for bug reports. Anything tagged with “bug” is open to whoever wants to implement it. If you discover a bug in TensorLayer you can fix yourself, by all means feel free to just implement a fix and not report it first.

Write documentation

Whenever you find something not explained well, misleading, glossed over or just wrong, please update it! The Edit on GitHub link on the top right of every documentation page and the [source] link for every documented entity in the API reference will help you to quickly locate the origin of any text.

How to contribute

Edit on GitHub

As a very easy way of just fixing issues in the documentation, use the Edit on GitHub link on the top right of a documentation page or the [source] link of an entity in the API reference to open the corresponding source file in GitHub, then click the Edit this file link to edit the file in your browser and send us a Pull Request. All you need for this is a free GitHub account.

For any more substantial changes, please follow the steps below to setup TensorLayer for development.


The documentation is generated with Sphinx. To build it locally, run the following commands:

pip install Sphinx

cd docs
make html

If you want to re-generate the whole docs, run the following commands:

cd docs
make clean
make html

To write the docs, we recommend you to install Local RTD VM.

Afterwards, open docs/_build/html/index.html to view the documentation as it would appear on readthedocs. If you changed a lot and seem to get misleading error messages or warnings, run make clean html to force Sphinx to recreate all files from scratch.

When writing docstrings, follow existing documentation as much as possible to ensure consistency throughout the library. For additional information on the syntax and conventions used, please refer to the following documents:


TensorLayer has a code coverage of 100%, which has proven very helpful in the past, but also creates some duties:

  • Whenever you change any code, you should test whether it breaks existing features by just running the test scripts.

  • Every bug you fix indicates a missing test case, so a proposed bug fix should come with a new test that fails without your fix.

Sending Pull Requests

When you’re satisfied with your addition, the tests pass and the documentation looks good without any markup errors, commit your changes to a new branch, push that branch to your fork and send us a Pull Request via GitHub’s web interface.

All these steps are nicely explained on GitHub:

When filing your Pull Request, please include a description of what it does, to help us reviewing it. If it is fixing an open issue, say, issue #123, add Fixes #123, Resolves #123 or Closes #123 to the description text, so GitHub will close it when your request is merged.