code: def _detach_hidden(
      hidden: Union[torch.Tensor, Sequence, Mapping, str, bytes]
  ) -> Union[
      torch.Tensor,
      collections.Sequence,
      collections.Mapping,
      str,
      bytes,
  ]:
      """Cut backpropagation graph.
  
      Auxillary function to cut the backpropagation graph by detaching the hidden
      vector.
      """
      return apply_to_tensor(hidden, torch.Tensor.detach)
  
file_path: ignite/ignite/contrib/engines/tbptt.py
imports: import collections.abc
  from typing import Callable, Mapping, Optional, Sequence, Union
  import torch
  import torch.nn
  from torch.optim.optimizer import Optimizer
  from ignite.engine import _prepare_batch, Engine, EventEnum
  from ignite.utils import apply_to_tensor
label_desc: Use image node_id 1 for calling a global function with example usage: _detach_hidden(hidden) and returns: apply_to_tensor