class_docstr: Encoder Decoder depther.
  
  EncoderDecoder typically consists of backbone and decode_head.
class_docstr_tok: ["Encoder","Decoder","depther",".","EncoderDecoder","typically","consists","of","backbone","and","decode_head","."]
docstr: The iteration step during training.
  
  This method defines an iteration step during training, except for the
  back propagation and optimizer updating, which are done in an optimizer
  hook. Note that in some complicated cases or models, the whole process
  including back propagation and optimizer updating is also defined in
  this method, such as GAN.
  
  Args:
      data (dict): The output of dataloader.
      optimizer (:obj:`torch.optim.Optimizer` | dict): The optimizer of
          runner is passed to ``train_step()``. This argument is unused
          and reserved.
  
  Returns:
      dict: It should contain at least 3 keys: ``loss``, ``log_vars``,
          ``num_samples``.
          ``loss`` is a tensor for back propagation, which can be a
          weighted sum of multiple losses.
          ``log_vars`` contains all the variables to be sent to the
          logger.
          ``num_samples`` indicates the batch size (when the model is
          DDP, it means the batch size on each GPU), which is used for
          averaging the logs.
docstr_tok: ["The","iteration","step","during","training",".","This","method","defines","an","iteration","step","during","training",",","except","for","the","back","propagation","and","optimizer","updating",",","which","are","done","in","an","optimizer","hook",".","Note","that","in","some","complicated","cases","or","models",",","the","whole","process","including","back","propagation","and","optimizer","updating","is","also","defined","in","this","method",",","such","as","GAN",".","Args",":","data","(","dict",")",":","The","output","of","dataloader",".","optimizer","(",":","obj",":","`","torch.optim.Optimizer","`","|","dict",")",":","The","optimizer","of","runner","is","passed","to","``","train_step","(",")","``",".","This","argument","is","unused","and","reserved",".","Returns",":","dict",":","It","should","contain","at","least","3","keys",":","``","loss","``",",","``","log_vars","``",",","``","num_samples","``",".","``","loss","``","is","a","tensor","for","back","propagation",",","which","can","be","a","weighted","sum","of","multiple","losses",".","``","log_vars","``","contains","all","the","variables","to","be","sent","to","the","logger",".","``","num_samples","``","indicates","the","batch","size","(","when","the","model","is","DDP",",","it","means","the","batch","size","on","each","GPU",")",",","which","is","used","for","averaging","the","logs","."]
code: def train_step(self, data_batch, optimizer, **kwargs):
      """The iteration step during training.
  
      This method defines an iteration step during training, except for the
      back propagation and optimizer updating, which are done in an optimizer
      hook. Note that in some complicated cases or models, the whole process
      including back propagation and optimizer updating is also defined in
      this method, such as GAN.
  
      Args:
          data (dict): The output of dataloader.
          optimizer (:obj:`torch.optim.Optimizer` | dict): The optimizer of
              runner is passed to ``train_step()``. This argument is unused
              and reserved.
  
      Returns:
          dict: It should contain at least 3 keys: ``loss``, ``log_vars``,
              ``num_samples``.
              ``loss`` is a tensor for back propagation, which can be a
              weighted sum of multiple losses.
              ``log_vars`` contains all the variables to be sent to the
              logger.
              ``num_samples`` indicates the batch size (when the model is
              DDP, it means the batch size on each GPU), which is used for
              averaging the logs.
      """
      losses = self(**data_batch)
  
      # split losses and images
      real_losses = {}
      log_imgs = {}
      for k, v in losses.items():
          if "img" in k:
              log_imgs[k] = v
          else:
              real_losses[k] = v
  
      loss, log_vars = self._parse_losses(real_losses)
  
      outputs = dict(
          loss=loss,
          log_vars=log_vars,
          num_samples=len(data_batch["img_metas"]),
          log_imgs=log_imgs,
      )
  
      return outputs
  
imports: from collections import OrderedDict
  import torch
  import torch.nn
  import torch.nn.functional
  from .ops import resize
label_desc: Use image node_id 15 for calling the DepthEncoderDecoder obj's underlying member method code with example usage: obj.train_step(data_batch, optimizer) and returns: outputs