code: def _recursive_copy_and_cast(
      target: _typing.Union[list, tuple, dict, set, _torch.Tensor],
      device: _typing.Optional[_torch.device],
  ) -> _torch.Tensor:
      def map_fn(x):
          if _torch.is_tensor(x):
              return _copy_tensor(x, True, device=device)
          else:
              return x
  
      return _recursive_map(target, map_fn)
  
file_path: higher/higher/utils.py
imports: import torch
  import typing
label_desc: Use image node_id 2 for calling a global function with example usage: _recursive_copy_and_cast(target, device) and returns: _recursive_map, _copy_tensor, x