tfdocs.doc_generator_visitor.DocGeneratorVisitor

A visitor that generates docs for a python object when called.

duplicate_of A map from duplicate full names to a preferred fully qualified name.

This map only contains names that are not themself a preferred name.

It is computed when it, reverse_index, or duplicates are first accessed.

duplicates A map from preferred full names to a list of all names for this symbol.

This function returns a map from preferred (main) name for a symbol to a lexicographically sorted list of all aliases for that name (incl. the main name). Symbols without duplicate names do not appear in this map.

It is computed when it, reverse_index, or duplicate_of are first accessed.

index A map from fully qualified names to objects to be documented.

The index is filled when the visitor is passed to traverse.

reverse_index A map from id(object) to the preferred fully qualified name.

This map only contains non-primitive objects (no numbers or strings) present in index (for primitive objects, id() doesn't quite do the right thing).

It is computed when it, duplicate_of, or duplicates are first accessed.

tree A map from fully qualified names to all its child names for traversal.

The full name to member names map is filled when the visitor is passed to traverse.

Child Classes

class NameScore

Methods

build

View source

Compute data structures containing information about duplicates.

Find duplicates in index and decide on one to be the "main" name.

Computes a reverse_index mapping each object id to its main name.

Also computes a map duplicate_of from aliases to their main name (the main name itself has no entry in this map), and a map duplicates from main names to a lexicographically sorted list of all aliases for that name (incl. the main name).

All these are computed and set as fields if they haven't already.

__call__

View source

Visitor interface, see tensorflow/tools/common:traverse for details.

This method is called for each symbol found in a traversal using tensorflow/tools/common:traverse. It should not be called directly in user code.

Args
parent_path A tuple of strings. The fully qualified path to a symbol found during traversal.
parent The Python object referenced by parent_name.
children A list of (name, py_object) pairs enumerating, in alphabetical order, the children (as determined by inspect.getmembers) of parent. name is the local name of py_object in parent.

Returns
The list of children, with any metaclass removed.

Raises
RuntimeError If this visitor is called with a parent that is not a class or module.