class_docstr: Head for sentence-level classification tasks.
code: def __init__(
      self,
      d_model,
      num_classes,
      pooling_mode="MEAN",
      batch_first=False,
      **kwargs,
  ):
      super().__init__()
      assert pooling_mode in [
          "MEAN",
          "SUM",
          "CLS",
          "LAST",
          "FLATTEN",
      ], "pooling_mode not supported"
      self.pooling_mode = pooling_mode
      self.batch_first = batch_first
      self.out_proj = nn.Linear(d_model, num_classes)
  
imports: import math
  from functools import partial
  from collections import namedtuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.utils import _pair
  import hydra
  from einops import reduce, rearrange
label_desc: Use image node_id 1 to create a new ClassificationHeadLinear object from inherited base classes: nn with example: obj = ClassificationHeadLinear(d_model, num_classes, pooling_mode, batch_first)