parameters: (batch: Batch)
docstring: Detaches from autograd graph.
docstring_summary: Detaches from autograd graph.
docstring_tokens: Detaches from autograd graph .
function: def detach(batch: Batch) -> None:
      """Detaches from autograd graph."""
      for i, x in enumerate(batch):
          batch[i] = x.detach().requires_grad_(x.requires_grad)
function_tokens: def detach ( batch : Batch ) -> None : for i , x in enumerate ( batch ) : batch [ i ] = x . detach ( ) . requires_grad_ ( x . requires_grad )