I have heard that tf.function
can build graph and accelerate computation. But when can we use it?
From another answer, seems like:
when we are not using built-in functions
Any more specific answer?
I have heard that tf.function
can build graph and accelerate computation. But when can we use it?
From another answer, seems like:
when we are not using built-in functions
Any more specific answer?
Here is a link that count pros of tf.function. Imagine you have a loss function, adding this keyword on top of your function can helps Tensorflow to run it faster however you might face error like
ValueError: tf.function-decorated function tried to create variables on non-first call.
if you are not initializing all variables in the first run.