class_docstr: Class implements torch model's main methods.
  
  Args:
      model: torch.nn.Model-based neural network model
      device: device to use
      optimizer: name of `torch.optim` optimizer
      optimizer_parameters: dictionary with optimizer parameters
      learning_rate_drop_patience: how many validations with no improvements to wait
      learning_rate_drop_div: the divider of the learning rate after `learning_rate_drop_patience` unsuccessful
          validations
      load_before_drop: whether to load best model before dropping learning rate or not
      min_learning_rate: min value of learning rate if learning rate decay is used
      args:
      kwargs: dictionary with other model parameters
  
  Attributes:
      device: `cpu` or `cuda` device to use
      opt: dictionary with all model parameters
      model: torch model
      epochs_done: number of epochs that were done
      optimizer: `torch.optim` instance
      learning_rate_drop_patience: how many validations with no improvements to wait
      learning_rate_drop_div: the divider of the learning rate after `learning_rate_drop_patience` unsuccessful
          validations
      load_before_drop: whether to load best model before dropping learning rate or not
      min_learning_rate: min value of learning rate if learning rate decay is used
      clip_norm: clip gradients by norm coefficient
class_docstr_tok: ["Class","implements","torch","model","'s","main","methods",".","Args",":","model",":","torch.nn.Model-based","neural","network","model","device",":","device","to","use","optimizer",":","name","of","`","torch.optim","`","optimizer","optimizer_parameters",":","dictionary","with","optimizer","parameters","learning_rate_drop_patience",":","how","many","validations","with","no","improvements","to","wait","learning_rate_drop_div",":","the","divider","of","the","learning","rate","after","`","learning_rate_drop_patience","`","unsuccessful","validations","load_before_drop",":","whether","to","load","best","model","before","dropping","learning","rate","or","not","min_learning_rate",":","min","value","of","learning","rate","if","learning","rate","decay","is","used","args",":","kwargs",":","dictionary","with","other","model","parameters","Attributes",":","device",":","`","cpu","`","or","`","cuda","`","device","to","use","opt",":","dictionary","with","all","model","parameters","model",":","torch","model","epochs_done",":","number","of","epochs","that","were","done","optimizer",":","`","torch.optim","`","instance","learning_rate_drop_patience",":","how","many","validations","with","no","improvements","to","wait","learning_rate_drop_div",":","the","divider","of","the","learning","rate","after","`","learning_rate_drop_patience","`","unsuccessful","validations","load_before_drop",":","whether","to","load","best","model","before","dropping","learning","rate","or","not","min_learning_rate",":","min","value","of","learning","rate","if","learning","rate","decay","is","used","clip_norm",":","clip","gradients","by","norm","coefficient"]
code: def _make_step(self, loss: torch.Tensor) -> None:
      loss.backward()
      if self.clip_norm is not None:
          torch.nn.utils.clip_grad_norm_(
              self.model.parameters(), self.clip_norm
          )
      self.optimizer.step()
  
file_path: DeepPavlov/deeppavlov/core/models/torch_model.py
imports: from abc import abstractmethod
  from logging import getLogger
  from pathlib import Path
  from typing import Optional, Union
  import torch
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.models.nn_model import NNModel
label_desc: Use image node_id 8 for calling the TorchModel obj's underlying member method code with example usage: obj._make_step(loss) without return types