def tensor_image_converter(tensor):
    """
    Converts PyTorch Tensor to Numpy Array (Image)
    """
    tensor = tensor.squeeze()

    if len(tensor.shape) > 2:
        tensor = tensor.permute(1, 2, 0)

    img = tensor.detach().cpu().numpy()
    return img