docstr: Convert a NumPy image to a PyTorch tensor.
docstr_tok: ["Convert","a","NumPy","image","to","a","PyTorch","tensor","."]
code: def numpy_to_pt(images: np.ndarray) -> torch.FloatTensor:
      """
      Convert a NumPy image to a PyTorch tensor.
      """
      if images.ndim == 3:
          images = images[..., None]
  
      images = torch.from_numpy(images)
      return images
  
imports: import warnings
  from typing import List, Optional, Union
  import numpy
  import PIL
  import torch
  from diffusers import ConfigMixin
  from diffusers.image_processor import VaeImageProcessor
  from diffusers.utils.pil_utils import PIL_INTERPOLATION
  from PIL import Image
  from tqdm.auto import tqdm
label_desc: Use image node_id 5 for calling the VaeImageProcessor obj's underlying member method code with example usage: obj.numpy_to_pt(images) and returns: images