tf.nest.map_structure

View source on GitHub

Applies func to each entry in structure and returns a new structure.

tf.nest.map_structure(
    func, *structure, **kwargs
)

Applies func(x[0], x[1], ...) where x[i] is an entry in structure[i]. All structures in structure must have the same arity, and the return value will contain results with the same structure layout.

Args:

Returns:

A new structure with the same arity as structure, whose values correspond to func(x[0], x[1], ...) where x[i] is a value in the corresponding location in structure[i]. If there are different sequence types and check_types is False the sequence types of the first structure will be used.

Raises: