Time:11-12
Based on the answer to a question I asked
This way you do not have to use tf.config.run_functions_eagerly(True) or if y_true.shape[1] is not None.
tf.config.run_functions_eagerly(True)
if y_true.shape[1] is not None
Page link:https//www.codepudding.com/Softwareengineering/187963.html