Recursively converts the Struct
value
to a new container type.
tff.structure.to_container_recursive(
value: tff.structure.Struct
,
container_fn: Callable[[list[tuple[Optional[str], Any]]], Any]
) -> Any
This function is always recursive, since the non-recursive version would be
just container_fn(value)
.
Args |
value
|
An Struct , possibly nested.
|
container_fn
|
A function that takes a list of (name, value) tuples ( the
elements of an Struct ), and returns a new container holding the same
values.
|
Returns |
A nested container of the type returned by container_fn .
|