tff.types.type_to_tf_tensor_specs
Returns nested structure of tf.TensorSpec
s for a given TFF type.
tff.types.type_to_tf_tensor_specs(
type_spec: tff.types.Type
)
The dtypes and shapes of the returned tf.TensorSpec
s match those used by
tf.data.Dataset
s to indicate the type and shape of their elements. They can
be used, e.g., as arguments in constructing an iterator over a string handle.
Args |
type_spec
|
A computation_types.Type , the type specification must be
composed of only named tuples and tensors. In all named tuples that appear
in the type spec, all the elements must be named.
|
Returns |
A nested structure of tf.TensorSpec s with the dtypes and shapes of tensors
defined in type_spec . The layout of the structure returned is the same as
the layout of the nested type defined by type_spec . Named tuples are
represented as dictionaries.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-20 UTC.
[null,null,["Last updated 2024-09-20 UTC."],[],[]]