class_docstr: GradientNormClipping callback, which uses 'torch.nn.utils.clip_grad_norm_' to clip the gradient norms to the
  given value. If params is None they will be retrieved from state.
  
  Example: ::
  
      >>> import torch.nn
      >>> from torchbearer import Trial
      >>> from torchbearer.callbacks import GradientNormClipping
  
      # Example Trial which clips all model gradients norms at 2 under the L1 norm.
      >>> model = torch.nn.Linear(1,1)
      >>> clip = GradientNormClipping(2, 1)
      >>> trial = Trial(model, callbacks=[clip], metrics=['acc'])
  
  Args:
      max_norm (float or int): max norm of the gradients
      norm_type (float or int): type of the used p-norm. Can be ``'inf'`` for
          infinity norm.
      params (Iterable[Tensor] or Tensor, optional): an iterable of Tensors or a
          single Tensor that will have gradients normalized, otherwise this is retrieved from state
  
  State Requirements:
      - :attr:`torchbearer.state.MODEL`: Model should have the `parameters` method
class_docstr_tok: ["GradientNormClipping","callback",",","which","uses","'torch.nn.utils.clip_grad_norm_","'","to","clip","the","gradient","norms","to","the","given","value",".","If","params","is","None","they","will","be","retrieved","from","state",".","Example",":",":",":",">",">",">","import","torch.nn",">",">",">","from","torchbearer","import","Trial",">",">",">","from","torchbearer.callbacks","import","GradientNormClipping","#","Example","Trial","which","clips","all","model","gradients","norms","at","2","under","the","L1","norm",".",">",">",">","model","=","torch.nn.Linear","(","1,1",")",">",">",">","clip","=","GradientNormClipping","(","2",",","1",")",">",">",">","trial","=","Trial","(","model",",","callbacks=","[","clip","]",",","metrics=","[","'acc","'","]",")","Args",":","max_norm","(","float","or","int",")",":","max","norm","of","the","gradients","norm_type","(","float","or","int",")",":","type","of","the","used","p-norm",".","Can","be","``","'inf","'","``","for","infinity","norm",".","params","(","Iterable","[","Tensor","]","or","Tensor",",","optional",")",":","an","iterable","of","Tensors","or","a","single","Tensor","that","will","have","gradients","normalized",",","otherwise","this","is","retrieved","from","state","State","Requirements",":","-",":","attr",":","`","torchbearer.state.MODEL","`",":","Model","should","have","the","`","parameters","`","method"]
docstr: Between the backward pass (which computes the gradients) and the step call (which updates the parameters),
  clip the gradient.
  
  Args:
      state (dict): The :class:`.Trial` state
docstr_tok: ["Between","the","backward","pass","(","which","computes","the","gradients",")","and","the","step","call","(","which","updates","the","parameters",")",",","clip","the","gradient",".","Args",":","state","(","dict",")",":","The",":","class",":","`",".Trial","`","state"]
code: def on_backward(self, state):
      """Between the backward pass (which computes the gradients) and the step call (which updates the parameters),
      clip the gradient.
  
      Args:
          state (dict): The :class:`.Trial` state
      """
      torch.nn.utils.clip_grad_norm_(
          self.params, self.max_norm, norm_type=self.norm_type
      )
  
file_path: torchbearer/torchbearer/callbacks/gradient_clipping.py
imports: import torchbearer
  from torchbearer.callbacks import Callback
  import torch
label_desc: Use image node_id 3 for calling the GradientNormClipping obj's underlying member method code with example usage: obj.on_backward(state) without return types