You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In that case, when reshape_tensors_in_dataset is called in a loop, the function _reshape_tensor will create a new graph every time, and that can trigger tf.function retracing warning.
Hello! Our static bug checker has found a performance issue in m3tl/read_write_tfrecord.py:
reshape_tensors_in_dataset
is repeatedly called in a for loop, but there is a tf.function decorated function_reshape_tensor
defined and called inreshape_tensors_in_dataset
.In that case, when
reshape_tensors_in_dataset
is called in a loop, the function_reshape_tensor
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: