code: def numpy_to_torch(obj):
      """
      Convert to tensors all Numpy arrays inside a Python object composed of the supported types.
  
      Args:
          obj: The Python object to convert.
  
      Returns:
          A new Python object with the same structure as `obj` but where the Numpy arrays are now
          tensors. Not supported type are left as reference in the new object.
  
      Example:
          .. code-block:: python
  
              >>> from poutyne import numpy_to_torch
              >>> numpy_to_torch({
              ...     'first': np.array([1, 2, 3]),
              ...     'second':[np.array([4,5,6]), np.array([7,8,9])],
              ...     'third': 34
              ... })
              {
                  'first': tensor([1, 2, 3]),
                  'second': [tensor([4, 5, 6]), tensor([7, 8, 9])],
                  'third': 34
              }
  
  
      """
  
      def fn(a):
          return torch.from_numpy(a) if isinstance(a, np.ndarray) else a
  
      return _apply(obj, fn)
  
imports: import contextlib
  import numbers
  import os
  import random
  import warnings
  from typing import IO, Any, BinaryIO, Optional, Union
  import numpy
  import torch
  from torch.nn.utils.rnn import PackedSequence
  from torch.utils.data import Dataset
  from poutyne.warning_manager import warning_settings
label_desc: Use image node_id 6 for calling a global function with example usage: numpy_to_torch(obj) and returns: _apply, unknown