code: def step(self, batch: Any, batch_idx: BatchIndex):
      self.model.train(self.mode.is_train)
      data, target = batch["data"].to(self.device), batch["target"].to(
          self.device
      )
      target = (target - self.model.y_mean) / self.model.y_std
  
      if self.mode.is_train:
          tracker.add_global_step(len(data))
  
      output = self.model(data)
      loss = self.loss_func(output, target)
      tracker.add("loss.", loss)
  
      if self.mode.is_train:
          loss.backward()
          if batch_idx.is_last:
              tracker.add("model", self.model)
          self.optimizer.step()
          self.optimizer.zero_grad()
  
      if not self.mode.is_train:
          self.output_collector(
              output * self.model.y_std + self.model.y_mean
          )
  
      tracker.save()
  
file_path: labml/samples/stocks/minutely_stocks.py
imports: from typing import Tuple, List, Any
  from torch import nn
  from torch.utils.data import DataLoader
  from labml import experiment, tracker, monit
  from labml.configs import option, calculate
  from labml_helpers.metrics.collector import Collector
  from labml_helpers.train_valid import SimpleTrainValidConfigs, BatchIndex
  from stocks.dataset import MinutelyData, MinutelyDataset
  from stocks.model import CnnModel
label_desc: Use image node_id 2 for calling the Configs obj's underlying member method code with example usage: obj.step(batch, batch_idx) without return types