TensorFlow Interview Questions and Answers
Question: What is the purpose of the tf.function decorator in TensorFlow 2.x?Answer: The tf.function decorator is used to convert a Python function into a TensorFlow graph, allowing for better performance through graph execution and enabling graph optimizations.Example: @tf.function 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: