code: def rescale_torch_tensor(
      tensor: torch.Tensor,
      new_min: torch.Tensor,
      new_max: torch.Tensor,
      prev_min: torch.Tensor,
      prev_max: torch.Tensor,
  ):
      """
      Rescale column values in N X M torch tensor to be in new range.
      Each column m in input tensor will be rescaled from range
      [prev_min[m], prev_max[m]] to [new_min[m], new_max[m]]
      """
      assert tensor.shape[1] == new_min.shape[1] == new_max.shape[1]
      assert tensor.shape[1] == prev_min.shape[1] == prev_max.shape[1]
      prev_range = prev_max - prev_min
      new_range = new_max - new_min
      return ((tensor - prev_min) / prev_range) * new_range + new_min
  
file_path: ReAgent/reagent/core/torch_utils.py
imports: from io import BytesIO
  from typing import Dict, List
  import numpy
  import torch
  from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor
label_desc: Use image node_id 2 for calling a global function with example usage: rescale_torch_tensor(tensor, new_min, new_max, prev_min, prev_max) and returns: unknown