original_docstring: Runs the forward pass of the model.
  
          Args:
              batch (Batch): A dictionary of Dict[str, Tensor] of inputs that the
                  model expects, as found in MosaicTransformer.get_model_inputs().
  
          Returns:
              A dictionary of model outputs as a ``Mapping``. It will include the loss
              if `labels` is passed as an input.
          
docstring: Runs the forward pass of the model.
docstring_tokens: Runs the forward pass of the model .
code: def forward(self, batch: Batch) -> Mapping:
          """Runs the forward pass of the model.
  
          Args:
              batch (Batch): A dictionary of Dict[str, Tensor] of inputs that the
                  model expects, as found in MosaicTransformer.get_model_inputs().
  
          Returns:
              A dictionary of model outputs as a ``Mapping``. It will include the loss
              if `labels` is passed as an input.
          """
          if not isinstance(batch, dict):
              raise ValueError(f'Model expects batch to be a dict, got {type(batch)}')
  
          for key in self.model_inputs:
              if key not in batch.keys():
                  raise ValueError(f'Batch missing key: {key}')
  
          output = self.module(**batch)  # type: ignore (thirdparty)
          return output
code_tokens: def forward ( self , batch : Batch ) -> Mapping : if not isinstance ( batch , dict ) : raise ValueError ( f'Model expects batch to be a dict, got {type(batch)}' ) for key in self . model_inputs : if key not in batch . keys ( ) : raise ValueError ( f'Batch missing key: {key}' ) output = self . module ( ** batch ) return output
short_docstring: Runs the forward pass of the model.
short_docstring_tokens: Runs the forward pass of the model .
comment: """Runs the forward pass of the model.
  
          Args:
              batch (Batch): A dictionary of Dict[str, Tensor] of inputs that the
                  model expects, as found in MosaicTransformer.get_model_inputs().
  
          Returns:
              A dictionary of model outputs as a ``Mapping``. It will include the loss
              if `labels` is passed as an input.
          """$SEP$# type: ignore (thirdparty)