tensorflow / datasets

TFDS is a collection of datasets ready to use with TensorFlow, Jax, ...
https://www.tensorflow.org/datasets
Apache License 2.0
4.3k stars 1.54k forks source link

API docs for `tf.data.AUTOTUNE` #3306

Open 8bitmp3 opened 3 years ago

8bitmp3 commented 3 years ago

Description of issue

API docs for tf.data.AUTOTUNE (e.g. here https://www.tensorflow.org/guide/data_performance) lead to https://www.tensorflow.org/api_docs/python/tf/data#AUTOTUNE which doesn't currently have a description (e.g. "prompts the tf.data runtime to tune the value dynamically at runtime"). (UPDATE: the API appears to be out of experimental and is used in a lot of examples).

Submit a pull request?

Can submit a PR. UPDATE: Similar to https://www.tensorflow.org/api_docs/python/tf/data/experimental/CsvDataset, we could document it as e.g. _"For num_parallel_calls, use tf.data.AUTOTUNE to set the number of parallel calls dynamically based on available CPU."_

cc @MarkDaoust @lamberta @wolffg

MarkDaoust commented 3 years ago

Note: It's a bit tricky to add a docstring for this since it is just a python integer. And small python integers like this are singeltons. We;d need a mechanism to add docs by Name. It looks like the current implementation of _EXTRA_DOCS only implements extra docs by id().

  1. https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/types/doc_typealias.py
  2. https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docs/generate2.py#L238
  3. https://github.com/tensorflow/docs/blob/master/tools/tensorflow_docs/api_generator/parser.py#L925