examples/research_projects/vqgan-clip/img_processing.py/post_process_tensor
def post_process_tensor(x):
    x = torch.clamp(x, -1.0, 1.0)
    x = (x + 1.0) / 2.0
    x = x.permute(1, 2, 0)
    return x