class_docstr: A basic helper class to control the process of training or evaluation.
  It mainly composes of forward_backward_step for gradient backward and
  optimizer_step for parameters update.
  For the convenience to enable FP16, we aggregate all codes that contain the
  control of FP16 in class schedule.
  
  Args:
      data_process_func (Callable, optional): The preprocessing function which receives a batch of data and arranges them into data and label.
docstr: The process function over a batch of dataset for training or evaluation.
  
  Args:
      engine (colossalai.legacy.engine.Engine): Colossalai engine for training and inference.
      data_iter (Iterable): Data iterator from which get a batch of data, obtained by calling iter(dataloader).
      forward_only (bool): If True, the process won't include backward.
      return_loss (bool, optional): If False, the loss won't be returned.
      return_output_label (bool, optional): If False, the output and label won't be returned.
docstr_tok: ["The","process","function","over","a","batch","of","dataset","for","training","or","evaluation",".","Args",":","engine","(","colossalai.legacy.engine.Engine",")",":","Colossalai","engine","for","training","and","inference",".","data_iter","(","Iterable",")",":","Data","iterator","from","which","get","a","batch","of","data",",","obtained","by","calling","iter","(","dataloader",")",".","forward_only","(","bool",")",":","If","True",",","the","process","wo","n't","include","backward",".","return_loss","(","bool",",","optional",")",":","If","False",",","the","loss","wo","n't","be","returned",".","return_output_label","(","bool",",","optional",")",":","If","False",",","the","output","and","label","wo","n't","be","returned","."]
code: def forward_backward_step(
      self,
      engine,
      data_iter: Iterable,
      forward_only: bool,
      return_loss: bool = True,
      return_output_label: bool = True,
  ):
      """The process function over a batch of dataset for training or evaluation.
  
      Args:
          engine (colossalai.legacy.engine.Engine): Colossalai engine for training and inference.
          data_iter (Iterable): Data iterator from which get a batch of data, obtained by calling iter(dataloader).
          forward_only (bool): If True, the process won't include backward.
          return_loss (bool, optional): If False, the loss won't be returned.
          return_output_label (bool, optional): If False, the output and label won't be returned.
      """
  
file_path: colossalai/colossalai/legacy/engine/schedule/_base_schedule.py
imports: from abc import ABC, abstractmethod
  from typing import Callable, Iterable
  import torch
  from colossalai.logging import get_dist_logger
  from colossalai.utils import get_current_device
label_desc: Use image node_id 7 for calling the BaseSchedule obj's underlying member method code with example usage: obj.forward_backward_step(engine, data_iter, forward_only, return_loss, return_output_label) without return types