class_docstr: PyTorch implementation containing all the modelling needed for your NLP task. Combines a language
  model and a prediction head. Allows for gradient flow back to the language model component.
class_docstr_tok: ["PyTorch","implementation","containing","all","the","modelling","needed","for","your","NLP","task",".","Combines","a","language","model","and","a","prediction","head",".","Allows","for","gradient","flow","back","to","the","language","model","component","."]
docstr: Push data through the whole model and returns logits. The data will propagate through the language
  model and each of the attached prediction heads.
  
  :param kwargs: Holds all arguments that need to be passed to the language model and prediction head(s).
  :return: all logits as torch.tensor or multiple tensors.
code: def forward(self, **kwargs):
      """
      Push data through the whole model and returns logits. The data will propagate through the language
      model and each of the attached prediction heads.
  
      :param kwargs: Holds all arguments that need to be passed to the language model and prediction head(s).
      :return: all logits as torch.tensor or multiple tensors.
      """
  
      # Run forward pass of language model
      sequence_output, pooled_output = self.forward_lm(**kwargs)
  
      # Run forward pass of (multiple) prediction heads using the output from above
      all_logits = []
      if len(self.prediction_heads) > 0:
          for head, lm_out in zip(
              self.prediction_heads, self.lm_output_types
          ):
              # Choose relevant vectors from LM as output and perform dropout
              if lm_out == "per_token":
                  output = self.dropout(sequence_output)
              elif (
                  lm_out == "per_sequence"
                  or lm_out == "per_sequence_continuous"
              ):
                  output = self.dropout(pooled_output)
              elif (
                  lm_out == "per_token_squad"
              ):  # we need a per_token_squad because of variable metric computation later on...
                  output = self.dropout(sequence_output)
              else:
                  raise ValueError(
                      "Unknown extraction strategy from language model: {}".format(
                          lm_out
                      )
                  )
  
              # Do the actual forward pass of a single head
              all_logits.append(head(output))
      else:
          # just return LM output (e.g. useful for extracting embeddings at inference time)
          all_logits.append((sequence_output, pooled_output))
  
      return all_logits
  
imports: import copy
  import json
  import logging
  import os
  from pathlib import Path
  import multiprocessing
  import numpy
  import torch
  from torch import nn
  from transformers import AutoConfig
  from transformers.convert_graph_to_onnx import convert, quantize
  from farm.data_handler.processor import Processor
  from farm.modeling.language_model import LanguageModel
  from farm.modeling.prediction_head import PredictionHead, pick_single_fn
  from farm.utils import MLFlowLogger, stack
  import farm.conversion.transformers
label_desc: Use image node_id 9 for calling the AdaptiveModel obj's underlying member method code with example usage: obj.forward() and returns: all_logits