Skip to content

Conversation

@facaiy
Copy link
Member

@facaiy facaiy commented Apr 25, 2019

Fix #46
Related PRs: #140, #195, #196

bazel build tools/docs:build_docs
bazel-bin/tools/docs/build_docs --git_branch=master --output_dir=docs/api_docs/python/

I push the documnets generated to my repository, and everyone can preview it at https://github.com/facaiy/addons/blob/tf_addons_doc_preview/docs/api_docs/python/tfa.md

@facaiy facaiy requested a review from a team as a code owner April 25, 2019 08:16
@tensorflow tensorflow deleted a comment from googlebot Apr 25, 2019
@tensorflow tensorflow deleted a comment from googlebot Apr 25, 2019
@facaiy facaiy requested a review from seanpmorgan April 25, 2019 08:27
@facaiy
Copy link
Member Author

facaiy commented Apr 25, 2019

It's still not perfect, I think there are three problems, take tf_addons.activations as an example:

  1. we need to filter out those members of __futures__ module: absolute_import, division, print_function.
  2. tensorflow_docs cannot recognize tf.function function: sparsemax.
  3. we also need to bypass private member, for example: __version__ in https://github.com/facaiy/addons/blob/tf_addons_doc_preview/docs/api_docs/python/tf_addons.md

@lamberta @MarkDaoust Hi, can we find a better way to solve those problems?

@facaiy
Copy link
Member Author

facaiy commented Apr 29, 2019

Gently ping @lamberta @MarkDaoust

@facaiy
Copy link
Member Author

facaiy commented Apr 29, 2019

@seanpmorgan Sean, do we need to generate api documents for 0.3 release?

@lamberta
Copy link
Member

@yashk2810 recently added tensorflow/docs@5afa339 that should filter out a few more.
Yash, can you look into the other issues in this PR? Thanks

@facaiy
Copy link
Member Author

facaiy commented Apr 29, 2019

Thank you, Billy, I'll take a try today

@MarkDaoust
Copy link
Member

So for those three questions:

  1. Should be fixed.
  2. The simplest fix is to patch in tensorflow's version of the tf_inspect module, since tf.function is following the tf_decoratorprotocol.
from tensorflow_docs.api_generator import parser
from tensorflow.python.util import tf_inspect

 # Use tensorflow's `tf_inspect`, which is aware of `tf_decorator`.
parser.tf_inspect = tf_inspect
  1. It's not clear that blocking all __dunder__ symbols is the right answer. The simplest way to block a single symbol is to just delete it from the module before running the doc generator del tf_addons.__version__. Passing private_map={'tf_addons',['__version__']} to the constructor would also work. If you need a more powerful filter you can add a callback to the list "callbacks=[public_api.local_definitions_filter]".

@facaiy
Copy link
Member Author

facaiy commented Apr 30, 2019

@MarkDaoust Awesome, it works. Thanks for your help, Mark!

@facaiy
Copy link
Member Author

facaiy commented Apr 30, 2019

@seanpmorgan @tensorflow/sig-addons-maintainers Hi, we can preview the document at https://github.com/facaiy/addons/blob/tf_addons_doc_preview/docs/api_docs/python/tfa.md

Could you take a look? And I think we can use it to generate API doc for 0.3 release.

@seanpmorgan
Copy link
Member

@facaiy This looks great, thanks for getting this done it is much needed. My only question would be how do we intend to upload the docs on the release branch given the .gitignore? We could modify the .gitignore on the release branch?

Other than that LGTM for merging

@facaiy
Copy link
Member Author

facaiy commented Apr 30, 2019

My only question would be how do we intend to upload the docs on the release branch given the .gitignore?

Good question! We have to use git add -f doc to do it explicitly on the release branch. I'm worried that someone might add doc into master branch inadvertently, that's why we put /doc/ in the gitignore file.

Copy link
Member

@seanpmorgan seanpmorgan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@seanpmorgan seanpmorgan merged commit 0ec96a6 into tensorflow:master Apr 30, 2019
@facaiy facaiy deleted the BLD/gen_doc branch May 1, 2019 02:28
bermeitinger-b pushed a commit to bermeitinger-b/addons that referenced this pull request May 21, 2019
* ENH: integrate with bazel

* DOC: how to install dependencies

* FIX: tf.function and __version__

* DOC: use tfa as short name

* DOC: add tutorial in details
bermeitinger-b pushed a commit to bermeitinger-b/addons that referenced this pull request May 21, 2019
* ENH: integrate with bazel

* DOC: how to install dependencies

* FIX: tf.function and __version__

* DOC: use tfa as short name

* DOC: add tutorial in details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate API docs

6 participants