From 8693a9eaa3187f50549a29d8c008a6fb10af5cbd Mon Sep 17 00:00:00 2001 From: Yash Katariya Date: Mon, 12 Aug 2019 16:59:21 -0700 Subject: [PATCH] Set the library name based on the version of TensorFlow PiperOrigin-RevId: 263035092 --- tensorflow/tools/docs/generate2.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tensorflow/tools/docs/generate2.py b/tensorflow/tools/docs/generate2.py index 0e8cba27e14..3951da0b9a8 100644 --- a/tensorflow/tools/docs/generate2.py +++ b/tensorflow/tools/docs/generate2.py @@ -250,8 +250,13 @@ def build_docs(output_dir, code_url_prefix, search_hints=True): "https://github.com/tensorflow/estimator/tree/master/tensorflow_estimator", ) + if LooseVersion(tf.__version__) < LooseVersion('2'): + root_title = 'TensorFlow' + elif LooseVersion(tf.__version__) >= LooseVersion('2'): + root_title = 'TensorFlow 2.0' + doc_generator = generate_lib.DocGenerator( - root_title="TensorFlow 2.0 Preview", + root_title=root_title, py_modules=[("tf", tf)], base_dir=base_dirs, search_hints=search_hints,