code: def image_to_255_scale(
      image: Tensor, dtype: Optional[torch.dtype] = None
  ) -> Tensor:
      """
      Helper function for converting a floating point image to 255 scale.
  
      The input image is expected to be in the range [0.0, 1.0]. If it is outside
      this range, the function throws an error.
  
      Args:
          image: A 4-D PyTorch tensor.
          dtype: Output datatype. If not passed, the image is of the same dtype
              as the input.
  
      Returns:
          The image in [0, 255] scale.
      """
      if image.max() > 1.0:
          raise ValueError("Unexpected image max > 1.0")
      if image.min() < 0.0:
          raise ValueError("Unexpected image min < 0.0")
  
      image = torch.round(image * 255.0)
  
      if dtype is not None:
          image = image.to(dtype)
  
      return image
  
label_desc: Use image node_id 1 for calling a global function with example usage: image_to_255_scale(image, dtype) and returns: image