code: def rescale_image(
      image: Tensor, back_to_float: bool = True
  ) -> Tensor:
      dtype = image.dtype
      image = (image * 255 + 0.5).to(torch.uint8)
  
      if back_to_float:
          image = image.to(dtype)
  
      return image
  
file_path: NeuralCompression/projects/illm/eval_folder_example.py
imports: from argparse import ArgumentParser
  from pathlib import Path
  import torch
  from PIL import Image
  from torch import Tensor
  from torchmetrics.image import FrechetInceptionDistance, LearnedPerceptualImagePatchSimilarity
  from torchvision.transforms import ToTensor
  from tqdm import tqdm
  from neuralcompression.metrics import MultiscaleStructuralSimilarity, calc_psnr, pickle_size_of, update_patch_fid
label_desc: Use image node_id 1 for calling a global function with example usage: rescale_image(image, back_to_float) and returns: image