diff options
author | Anna R <annarev@google.com> | 2018-07-16 18:11:37 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-07-16 18:14:45 -0700 |
commit | d8f3425e5b054dff01b5ece80e8c8a101c4ed816 (patch) | |
tree | 5a6d888dc60afce0c93bbfd8a1c457bb687c71e7 /tensorflow/tools/docs | |
parent | 2c442d26f36a0f167685fd31b9ecdb4e290c2b29 (diff) |
Handle deprecated fields in api_def.proto.
Also update how canonical endpoint name is set in doc_generator_visitor.py.
PiperOrigin-RevId: 204841165
Diffstat (limited to 'tensorflow/tools/docs')
-rw-r--r-- | tensorflow/tools/docs/doc_generator_visitor.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tensorflow/tools/docs/doc_generator_visitor.py b/tensorflow/tools/docs/doc_generator_visitor.py index 259a4694fd..c090dbd8da 100644 --- a/tensorflow/tools/docs/doc_generator_visitor.py +++ b/tensorflow/tools/docs/doc_generator_visitor.py @@ -20,6 +20,7 @@ from __future__ import print_function import six +from tensorflow.python.util import tf_export from tensorflow.python.util import tf_inspect @@ -201,7 +202,6 @@ class DocGeneratorVisitor(object): raw_duplicates[master_name] = [master_name, full_name] else: reverse_index[object_id] = full_name - # Decide on master names, rewire duplicates and make a duplicate_of map # mapping all non-master duplicates to the master name. The master symbol # does not have an entry in this map. @@ -211,10 +211,15 @@ class DocGeneratorVisitor(object): duplicates = {} for names in raw_duplicates.values(): names = sorted(names) - - # Choose the lexicographically first name with the minimum number of - # submodules. This will prefer highest level namespace for any symbol. - master_name = min(names, key=lambda name: name.count('.')) + master_name = ( + tf_export.get_canonical_name_for_symbol(self._index[names[0]]) + if names else None) + if master_name: + master_name = 'tf.%s' % master_name + else: + # Choose the lexicographically first name with the minimum number of + # submodules. This will prefer highest level namespace for any symbol. + master_name = min(names, key=lambda name: name.count('.')) duplicates[master_name] = names for name in names: |