code: def decode_img_as_tensor(
      img_content: bytes, dtype: tf.dtypes.DType = tf.float32
  ) -> tf.Tensor:
      """Read a byte stream as a TensorFlow tensor
  
      Args:
      ----
          img_content: bytes of a decoded image
          dtype: the desired data type of the output tensor. If it is float-related, values will be divided by 255.
  
      Returns:
      -------
          decoded image as a tensor
      """
      if dtype not in (tf.uint8, tf.float16, tf.float32):
          raise ValueError("insupported value for dtype")
  
      img = tf.io.decode_image(img_content, channels=3)
  
      if dtype != tf.uint8:
          img = tf.image.convert_image_dtype(img, dtype=dtype)
          img = tf.clip_by_value(img, 0, 1)
  
      return img
  
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 3 for calling a global function with example usage: decode_img_as_tensor(img_content, dtype) and returns: img