Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the docstring of @tf.exports methods in tf.nest. #36186

Merged
merged 15 commits into from Feb 19, 2020
17 changes: 12 additions & 5 deletions tensorflow/python/util/nest.py
Expand Up @@ -260,8 +260,9 @@ def flatten(structure, expand_composites=False):
running.

Args:
structure: an arbitrarily nested structure or a scalar object. Note, numpy
arrays are considered scalars.
structure: an arbitrarily nested structure which can be a scalar, or
tuple or dict or list of constructed scalars and/or other tuples/lists, or
a scalar object. Note, numpy arrays are considered scalars.
punndcoder28 marked this conversation as resolved.
Show resolved Hide resolved
expand_composites: If true, then composite tensors such as tf.SparseTensor
and tf.RaggedTensor are expanded into their component tensors.

Expand Down Expand Up @@ -306,8 +307,14 @@ def nt(a, b):
```

Args:
nest1: an arbitrarily nested structure.
nest2: an arbitrarily nested structure.
nest1: an arbitrarily nested structure which can be a scalar, or
tuple or dict or list of constructed scalars and/or other
tuples/lists, or a scalar object. Note, numpy arrays are considered
scalars.
nest2: an arbitrarily nested structure which can be a scalar, or
tuple or dict or list of constructed scalars and/or other
tuples/lists, or a scalar object. Note, numpy arrays are considered
scalars.
check_types: if `True` (default) types of sequences are checked as well,
including the keys of dictionaries. If set to `False`, for example a
list and a tuple of objects will look the same if they have the same
Expand Down Expand Up @@ -514,7 +521,7 @@ def map_structure(func, *structure, **kwargs):

Args:
func: A callable that accepts as many arguments as there are structures.
*structure: scalar, or tuple or list of constructed scalars and/or other
*structure: scalar, or tuple or dict or list of constructed scalars and/or other
tuples/lists, or scalars. Note: numpy arrays are considered as scalars.
**kwargs: Valid keyword args are:

Expand Down