Build api docs for tensorflow v2. Args: output_dir: A string path, where to put the files. code_url_prefix: prefix for "Defined in" links. search_hints: Bool. Include meta-data search hints at the top of each file.
(output_dir, code_url_prefix, search_hints=True)
| 205 | |
| 206 | |
| 207 | def build_docs(output_dir, code_url_prefix, search_hints=True): |
| 208 | """Build api docs for tensorflow v2. |
| 209 | |
| 210 | Args: |
| 211 | output_dir: A string path, where to put the files. |
| 212 | code_url_prefix: prefix for "Defined in" links. |
| 213 | search_hints: Bool. Include meta-data search hints at the top of each file. |
| 214 | """ |
| 215 | _hide_layer_and_module_methods() |
| 216 | |
| 217 | try: |
| 218 | doc_controls.do_not_generate_docs(tf.tools) |
| 219 | except AttributeError: |
| 220 | pass |
| 221 | |
| 222 | try: |
| 223 | doc_controls.do_not_generate_docs(tf.compat.v1.pywrap_tensorflow) |
| 224 | except AttributeError: |
| 225 | pass |
| 226 | |
| 227 | try: |
| 228 | doc_controls.do_not_generate_docs(tf.pywrap_tensorflow) |
| 229 | except AttributeError: |
| 230 | pass |
| 231 | |
| 232 | try: |
| 233 | doc_controls.do_not_generate_docs(tf.flags) |
| 234 | except AttributeError: |
| 235 | pass |
| 236 | |
| 237 | base_dir = path.dirname(tf.__file__) |
| 238 | |
| 239 | base_dirs = ( |
| 240 | base_dir, |
| 241 | # External packages base directories, |
| 242 | path.dirname(tensorboard.__file__), |
| 243 | path.dirname(tensorflow_estimator.__file__), |
| 244 | ) |
| 245 | |
| 246 | code_url_prefixes = ( |
| 247 | code_url_prefix, |
| 248 | # External packages source repositories, |
| 249 | "https://github.com/tensorflow/tensorboard/tree/master/tensorboard", |
| 250 | "https://github.com/tensorflow/estimator/tree/master/tensorflow_estimator", |
| 251 | ) |
| 252 | |
| 253 | if LooseVersion(tf.__version__) < LooseVersion('2'): |
| 254 | root_title = 'TensorFlow' |
| 255 | elif LooseVersion(tf.__version__) >= LooseVersion('2'): |
| 256 | root_title = 'TensorFlow 2.0' |
| 257 | |
| 258 | doc_generator = generate_lib.DocGenerator( |
| 259 | root_title=root_title, |
| 260 | py_modules=[("tf", tf)], |
| 261 | base_dir=base_dirs, |
| 262 | search_hints=search_hints, |
| 263 | code_url_prefix=code_url_prefixes, |
| 264 | site_path=FLAGS.site_path, |
no test coverage detected