TensorFlow Interview Questions and Answers
Question: Explain the purpose of the tf.function input_signature parameter.Answer: The input_signature parameter in tf.function specifies the input signature of the function. It helps in static shape checking, allowing TensorFlow to optimize the function for a specific input signature.Example: @tf.function(input_signature=[tf.TensorSpec(shape=(None,), dtype=tf.float32)]) def my_function(x): return x * x |
Save For Revision
Bookmark this item, mark it difficult, or place it in a revision set.
Log in to save bookmarks, difficult questions, and revision sets.
Is it helpful? Yes No
Most helpful rated by users: