<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def crop_or_pad_to(height, width):
 """Ensures the specified spatial shape by either padding or cropping. Meant to be used as a last transform for architectures insisting on a specific spatial shape of their inputs. """

    def inner(t_image):
        return tf.image.resize_image_with_crop_or_pad(t_image, height, width)
    return inner