class_docstr: BERT model for multiple choice,sequence labeling, ner, classification or regression
  This module is composed of the BERT model with a linear layer on top of
  the pooled output.
  Params:
  task_num_classes
  task_types
  backbone_model - na
class_docstr_tok: ["BERT","model","for","multiple","choice",",","sequence","labeling",",","ner",",","classification","or","regression","This","module","is","composed","of","the","BERT","model","with","a","linear","layer","on","top","of","the","pooled","output",".","Params",":","task_num_classes","task_types","backbone_model","-","na"]
code: def get_logits(
      self, task_id, input_ids, attention_mask, token_type_ids
  ):
      name = self.task_types[task_id]
      outputs = None
      if we_transform_input(name):
          input_ids = input_ids.view(-1, input_ids.size(-1))
          attention_mask = attention_mask.view(
              -1, attention_mask.size(-1)
          )
          if token_type_ids is not None:
              token_type_ids = token_type_ids.view(
                  -1, token_type_ids.size(-1)
              )
      if token_type_ids is None or not self.model_takes_token_type_ids:
          outputs = self.bert(
              input_ids=input_ids.long(),
              attention_mask=attention_mask.long(),
          )
      else:
          try:
              outputs = self.bert(
                  input_ids=input_ids.long(),
                  token_type_ids=token_type_ids.long(),
                  attention_mask=attention_mask.long(),
              )
          except Exception as e:
              if (
                  "forward() got an unexpected keyword argument 'token_type_ids'"
                  in str(e)
              ):
                  outputs = self.bert(
                      input_ids=input_ids.long(),
                      attention_mask=attention_mask.long(),
                  )
                  self.model_takes_token_type_ids = False
              else:
                  raise e
      if name == "sequence_labeling":
          return outputs.last_hidden_state
      elif self.new_model == 2:
          return outputs.last_hidden_state[:, task_id]
      elif self.new_model:
          return torch.cat(
              [
                  outputs.last_hidden_state[:, 0],
                  outputs.last_hidden_state[:, task_id + 1],
              ],
              axis=1,
          )
      else:
          return outputs.last_hidden_state[:, 0]
  
imports: from collections.abc import Iterable
  from logging import getLogger
  from pathlib import Path
  from typing import Dict, Optional
  import numpy
  import torch
  import torch.nn
  from torch.nn import CrossEntropyLoss, MSELoss, BCEWithLogitsLoss
  from transformers import AutoConfig, AutoModel
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.torch_model import TorchModel
  from deeppavlov.models.torch_bert.torch_transformers_sequence_tagger import token_from_subtoken, token_labels_to_subtoken_labels
label_desc: Use image node_id 2 for calling the BertForMultiTask obj's underlying member method code with example usage: obj.get_logits(task_id, input_ids, attention_mask, token_type_ids) and returns: outputs, outputs, torch, outputs