Creates an instance of Struct
from a Python container.
tff.structure.from_container(
value: object, recursive=False
) -> tff.structure.Struct
By default, this conversion is only performed at the top level for Python
dictionaries, collections.OrderedDict
s, namedtuple
s, list
s,
tuple
s, and attr.s
classes. Elements of these structures are not
recursively converted.
Args |
value
|
_The Python container to convert.
|
recursive
|
Whether to convert elements recursively (False by default).
|
Returns |
The corresponding instance of Struct .
|
Raises |
TypeError
|
If the value is not of one of the supported container types.
|