Inline test for failed random crop.
Inline test for failed random crop.

tf.data.Dataset.map uses tf.autograph to convert the input function so we can
use Python conditionals instead of tf.cond.

PiperOrigin-RevId: 296611536
Change-Id: Idb22f9251e8b0a42de46b8f5b2747091fd1add9b

deepmind/dm-haiku,deepmind/dm-haiku