tff.types.tensorflow_to_type
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Returns a tff.Type
for an obj
containing TensorFlow type specs.
tff.types.tensorflow_to_type(
obj: object
) -> tff.types.Type
This function extends tff.types.to_type
to handle TensorFlow type specs and
Python structures containing TensorFlow type specs:
For example:
tensorflow_to_type(tf.int32)
tff.TensorType(np.int32)
tensorflow_to_type((tf.int32, tf.TensorShape([2, 3])))
tff.TensorType(np.int32, (2, 3))
spec = tf.TensorSpec(shape=[2, 3], dtype=tf.int32)
tensorflow_to_type(spec)
tff.TensorType(np.int32, (2, 3))
spec = tf.data.DatasetSpec(tf.TensorSpec([2, 3], dtype=tf.int32))
tensorflow_to_type(spec)
tff.SequenceType(tff.TensorType(np.int32, (2, 3)))
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-10-04 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-04 UTC."],[],[]]