Applies fn
to each entry in structure
and returns a new structure.
tff.structure.map_structure(
fn: Callable[..., object], *structures
) -> object
This is a special implementation of tf.nest.map_structure
that works for Struct
.
Returns | |
---|---|
A new structure with the same arity as structure and same type as
structure[0] , whose values correspond to fn(x[0], x[1], ...) where
x[i] is a value in the corresponding location in structure[i] .
|
Raises | |
---|---|
TypeError
|
if fn is not a callable, or *structure is not all Struct or
all tf.Tensor typed values.
|
ValueError
|
if *structure is empty.
|