-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance issue about tf.function #32
Comments
Since there is |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! Our static bug checker has found a performance issue in adahessian_tf/run_experiments.py and adahessian_tf/cifar_training_tools.py:
cifar_training
is repeatedly called in a for loop, but there is a tf.function decorated functionstep
defined and called incifar_training
.In that case, when
cifar_training
is called in a loop, the functionstep
will create a new graph every time, and that can trigger tf.function retracing warning.Here is the tensorflow document to support it.
Briefly, for better efficiency, it's better to use:
than:
Looking forward to your reply.
The text was updated successfully, but these errors were encountered: