code: def tensor_to_ndarray(tensor: torch.Tensor):
      """
      Convert Pytorch tensor to numpy array.
  
      Parameters
      ----------
      tensor
          A Pytorch tensor.
  
      Returns
      -------
      A ndarray.
      """
      return tensor.detach().cpu().float().numpy()
  
file_path: autogluon/multimodal/src/autogluon/multimodal/utils/misc.py
imports: import json
  import logging
  import os
  import re
  import numpy
  import pandas
  import torch
  from scipy.special import expit, softmax
label_desc: Use image node_id 2 for calling a global function with example usage: tensor_to_ndarray(tensor) and returns: tensor