def crop_like(input, target):
    """Crop input hieght and width to match target."""
    if input.size()[2:] == target.size()[2:]:
        return input
    else:
        return input[:, :, :target.size(2), :target.size(3)]