code: def detach(obj):
      """
      Create a deep copy of an object, detaching all :class:`torch.Tensor` s in
      the object. No tensor data is actually copied.
  
      :param obj: Any python object.
      :returns: A deep copy of ``obj`` with all :class:`torch.Tensor` s detached.
      """
      memo = _DetachMemo()
      return copy.deepcopy(obj, memo)
  
imports: import copy
  import ctypes
  import functools
  import numbers
  import weakref
  from contextlib import contextmanager
  import torch
  import torch.distributions
  from torch import logsumexp
  from torch.distributions.utils import broadcast_all
  from pyro.util import ignore_jit_warnings
  from ..None import settings
label_desc: Use image node_id 3 for calling a global function with example usage: detach(obj) and returns: copy