class_docstr: A helper schedule class for no pipeline parallelism running environment.
  During one process, it loads a batch of dataset and feeds it to the model.
  After getting the output and calculating the loss, it will use :meth:`step`
  to update the parameters if it is in training mode.
  
  Args:
      data_process_func (Callable, optional): The preprocessing function which receives a batch of data
           and returns a tuple in the form of (data, label).
      and it will be executed in load_batch.
  
  Example:
      # this shows an example of customized data_process_func
      def data_process_func(dataloader_output):
          item1, item2, item3 = dataloader_output
          data = (item1, item2)
          label = item3
          return data, label
code: def __init__(self, data_process_func: Callable = None):
      # check that non-pipeline schedule data process func only takes in one parameter
      # which is the batch data
  
      if data_process_func:
          sig = inspect.signature(data_process_func)
          assert len(sig.parameters) == 1, (
              "The data_process_func only takes in one parameter for NonPipelineSchedule, "
              "which is a tuple of tensors for the current batch, "
              "i.e. data_process_func(dataloader_output)."
          )
  
      super().__init__(data_process_func)
  
file_path: ColossalAI/colossalai/legacy/engine/schedule/_non_pipeline_schedule.py
imports: import inspect
  from typing import Callable, Iterable
  import torch
  from colossalai.utils import conditional_context
  from ._base_schedule import BaseSchedule
label_desc: Use image node_id 1 to create a new NonPipelineSchedule object from inherited base classes: BaseSchedule with example: obj = NonPipelineSchedule(data_process_func)