Adding @tf.function Decorator

Generally, you do not have to manually add the @tf.function decorator function if you are using an official or well-designed script.

Particularly, if your script uses Keras's Model.fit API for model training, you can safely skip this step as the function is already encapsulated in the API.

If your script does not have the @tf.function decorator, refer to TF's description first before you add @tf.function to your training/validation/inference function and validate the function in the CPU or GPU environment.