class_docstr: This class implements attention pooling layer, as
  described in `Clip <https://arxiv.org/pdf/2103.00020.pdf>`_, and should be
  used for CNN-style models, including MobileViTs
class_docstr_tok: ["This","class","implements","attention","pooling","layer",",","as","described","in","`","Clip","<","https",":","\/\/arxiv.org\/pdf\/2103.00020.pdf",">","`","_",",","and","should","be","used","for","CNN-style","models",",","including","MobileViTs"]
code: def add_arguments(cls, parser: argparse.ArgumentParser):
      group = parser.add_argument_group(title=cls.__name__)
      group.add_argument(
          "--model.image-projection-head.attention-pool-nchw2nc.num-pos-embeddings",
          type=int,
          default=None,
          help="Number of positional embeddings",
      )
  
      group.add_argument(
          "--model.image-projection-head.attention-pool-nchw2nc.use-sinusoidal-pos-embeddings",
          action="store_true",
          help="Use sinusoidal positional embeddings instead of learnable",
      )
  
      group.add_argument(
          "--model.image-projection-head.attention-pool-nchw2nc.num-attn-heads",
          type=int,
          default=8,
          help="Number of attention heads in {}".format(cls.__name__),
      )
  
      group.add_argument(
          "--model.image-projection-head.attention-pool-nchw2nc.no-feature-normalization",
          action="store_true",
          help="Don't normalize image features",
      )
  
      group.add_argument(
          "--model.image-projection-head.attention-pool-nchw2nc.use-pytorch-mha",
          action="store_true",
          help="Use Pytorch Multi-head attention",
      )
  
      return parser
  
file_path: ml-cvnets/cvnets/image_projection_layers/attention_pool_2d.py
imports: import argparse
  import torch
  from torch import Tensor, nn
  from torch.nn import functional
  from cvnets.image_projection_layers import IMAGE_PROJECTION_HEAD_REGISTRY, BaseImageProjectionHead
  from cvnets.layers import MultiHeadAttention, PositionalEmbedding
  from utils import logger
label_desc: Use image node_id 2 for calling the AttentionPool2dHead obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser