![]() |
Filters children recursively.
tfdocs.public_api.local_definitions_filter(
path: Sequence[str],
parent: Any,
children: tfdocs.public_api.Children
) -> tfdocs.public_api.Children
Only returns those defined in this package.
This follows the API for visitors defined by traverse.traverse
.
This is a much tighter constraint than the default "base_dir" filter which ensures that only objects defined within the package root are documented. This applies a similar constraint, to each submodule.
in the api-tree below, Dense
is defined in tf.keras.layers
, but imported
into tf.layers
and tf.keras
.
tf
keras
from tf.keras.layers import Dense
layers
class Dense(...)
layers
from tf.keras.layers import Dense
This filter hides the tf.layers.Dense
reference as Dense
is not defined
within the tf.layers
package. The reference at tf.keras.Dense
is still
visible because dense is defined inside the tf.keras
tree.
One issue/feature to be aware of with this approach is that if you hide
the defining module, the object will not be visible in the docs at all. For
example, if used with the package below, util_1
and util_2
are never
documented.
my_package
_utils # leading `_` means private.
def util_1
def util_2
subpackage
from my_package._utils import *
Arguments:
path: A tuple or name parts forming the attribute-lookup path to this
object. For tf.keras.layers.Dense
path is:
("tf","keras","layers","Dense")
parent: The parent object.
children: A list of (name, value) pairs. The attributes of the patent.
Returns | |
---|---|
A filtered list of children (name, value) pairs.
|