code: def run_forward_only(
      self,
      model_chunk: Union[ModuleList, Module],
      data_iter: Iterable,
      criterion: Callable[..., Any],
      return_loss: bool = False,
      return_outputs: bool = False,
  ) -> Dict:
      assert self.forward_only
  
      self.load_batch(data_iter)
  
      outputs = (
          []
          if return_outputs
          and self.stage_manager.is_last_stage(ignore_chunk=True)
          else None
      )
  
      accum_loss = None
      if return_loss and self.stage_manager.is_last_stage(
          ignore_chunk=True
      ):
          accum_loss = torch.scalar_tensor(
              0, device=get_current_device()
          )
  
      model_chunk_id = self.get_model_chunk_id(0, is_forward=True)
      input_obj = self.recv_forward(model_chunk_id)
  
      for i in range(self.num_microbatch * self.num_model_chunks):
          last_iteration = (
              i == self.num_microbatch * self.num_model_chunks - 1
          )
          model_chunk_id = self.get_model_chunk_id(i, is_forward=True)
          output_obj = self.forward_step(
              model_chunk,
              model_chunk_id,
              input_obj,
              criterion,
              accum_loss,
              outputs,
          )
  
          if not last_iteration:
              input_obj = self.send_forward_recv_forward(
                  model_chunk_id_send=model_chunk_id,
                  model_chunk_id_recv=self.get_model_chunk_id(
                      i + 1, is_forward=True
                  ),
                  output_tensor=output_obj,
                  send_prior=self.stage_manager.stage % 2 == 0,
              )
          else:
              self.send_forward(model_chunk_id, output_obj)
  
      if outputs is not None:
          outputs = merge_batch(outputs)
      return {"loss": accum_loss, "outputs": outputs}
  
imports: from functools import partial
  from typing import Any, Callable, Dict, Iterable, List, Optional, Union
  import torch
  import torch.cuda
  from torch.nn import Module, ModuleList
  from torch.utils._pytree import tree_map
  from colossalai.interface import OptimizerWrapper
  from colossalai.pipeline.p2p import PipelineP2PCommunication, create_send_metadata
  from colossalai.pipeline.stage_manager import PipelineStageManager
  from colossalai.utils.device import get_current_device
  from ._utils import detach, get_batch_size, get_micro_batch, merge_batch, model_forward, retain_grad, to_device
  from .base import PipelineSchedule
label_desc: Use image node_id 15 for calling the InterleavedSchedule obj's underlying member method code with example usage: obj.run_forward_only(model_chunk, data_iter, criterion, return_loss, return_outputs) and returns: dict