LSTM-UNet
LSTM-UNet copied to clipboard
Performance issue in DataHandeling.py
Hello! Our static bug checker has found a performance issue in DataHandeling.py: normed_size
is repeatedly called in a for loop, but there is a tf.function decorated function q_stat
defined and called in normed_size
.
In that case, when normed_size
is called in a loop, the function q_stat
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:
@tf.function
def inner():
pass
def outer():
inner()
than:
def outer():
@tf.function
def inner():
pass
inner()
Looking forward to your reply.