|View source on GitHub|
func to each entry in
structure and returns a new structure.
tf.contrib.framework.nest.map_structure_with_tuple_paths( func, *structure, **kwargs )
func(tuple_path, x, x, ..., **kwargs) where
x[i] is an entry
tuple_path is a tuple of indices and/or dictionary
keys (as returned by
nest.yield_flat_paths), which uniquely specifies the
common path to x[i] in the structures. All structures in
structure must have
the same arity, and the return value will contain the results in the same
structure. Special kwarg
check_types determines whether the types of
iterables within the structure must be the same-- see **kwargs definition
func: A callable with the signature
func(tuple_path, *values, **kwargs)that is evaluated on the leaves of the structure.
*structure: A variable number of compatible structures to process.
**kwargs: Optional kwargs to be passed through to func. Special kwarg
check_typesis not passed to func, but instead determines whether the types of iterables within the structures have to be same (e.g.
map_structure(func, , (1,))raises a
TypeErrorexception). To allow this set this argument to
A structure of the same form as the input structures whose leaves are the result of evaluating func on corresponding leaves of the input structures.
funcis not callable or if the structures do not match each other by depth tree.
Falseand the two structures differ in the type of sequence in any of their substructures.
ValueError: If no structures are provided.