code: def _save_pytorch_device(pickler, obj: torch.device):
      has_index = obj.index is not None
      reduction: Union[Tuple[str, int], Tuple[str]]
      if has_index:
          reduction = (obj.type, obj.index)
      else:
          reduction = (obj.type,)
  
      pickler.save_reduce(_recreate_pytorch_device, reduction, obj=obj)
  
imports: from typing import Tuple, Union
  import torch
  import dill
label_desc: Use image node_id 4 for calling a global function with example usage: _save_pytorch_device(pickler, obj) without return types