code: def from_float32_to_uint8(
      tensor: tf.Tensor,
      tensor_key: str = "tensor",
      min_key: str = "min",
      max_key: str = "max",
  ) -> tf.Tensor:
      tensor_min = tf.reduce_min(tensor)
      tensor_max = tf.reduce_max(tensor)
      return {
          tensor_key: tf.cast(
              (tensor - tensor_min)
              / (tensor_max - tensor_min + 1e-16)
              * 255.9999,
              dtype=tf.uint8,
          ),
          min_key: tensor_min,
          max_key: tensor_max,
      }
  
file_path: spleeter/spleeter/utils/tensor.py
imports: from typing import Any, Callable, Dict
  import pandas
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: from_float32_to_uint8(tensor, tensor_key, min_key, max_key) and returns: dict