Refactor the RandomCrop logic for the boolean "training" flag handling.
Refactor the RandomCrop logic for the boolean "training" flag handling.

In tf2, the training flag should always be python boolean.

PiperOrigin-RevId: 430336909

keras-team/keras,keras-team/keras