code: def tensor_from_pil(
      pil_img: Image, dtype: tf.dtypes.DType = tf.float32
  ) -> tf.Tensor:
      """Convert a PIL Image to a TensorFlow tensor
  
      Args:
      ----
          pil_img: a PIL image
          dtype: the output tensor data type
  
      Returns:
      -------
          decoded image as tensor
      """
      npy_img = img_to_array(pil_img)
  
      return tensor_from_numpy(npy_img, dtype)
  
file_path: doctr/doctr/io/image/tensorflow.py
imports: from typing import Tuple
  import numpy
  import tensorflow
  from PIL import Image
  from tensorflow.keras.utils import img_to_array
  from doctr.utils.common_types import AbstractPath
label_desc: Use image node_id 1 for calling a global function with example usage: tensor_from_pil(pil_img, dtype) and returns: tensor_from_numpy