def torch_postprocessing(x, return_int=True):
    """
    Post-processing function to invert `torch_preprocessing` and clip values autside [0..255].

    Parameters
        x: numpy array with an image or a batch of images.
        return_int: boolean, whether to cast the image to `uint8`, returns `float` if False.

    Comments
        The color scaling is done in-place.
    """
    x[..., 0] *= 0.229
    x[..., 1] *= 0.224
    x[..., 2] *= 0.225
    x[..., 0] += 0.485
    x[..., 1] += 0.456
    x[..., 2] += 0.406
    x *= 255.
    if return_int:
        return x.clip(0, 255).astype('uint8')
    else:
        return x.clip(0, 255)