import tensorflow as tf

      tf.zeros(cutout_shape, dtype=images.dtype),
      padding_dims, constant_values=1)

  patch = tf.ones_like(images, dtype=images.dtype) * replace,

  mask = tf.expand_dims(mask, -1)
  mask = tf.tile(mask, [1, 1, num_channels])

  images = tf.where(
      tf.equal(mask, 0),
      patch,
      images)

  images = tf.squeeze(images, axis=0)

  return {'image': images, 'label': labels}
