class_docstr: This layer applies a single-head attention as described in `DeLighT <https://arxiv.org/abs/2008.00623>`_ paper
  
  Args:
      embed_dim (int): :math:`C_{in}` from an expected input of size :math:`(N, P, C_{in})`
      attn_dropout (Optional[float]): Attention dropout. Default: 0.0
      bias (Optional[bool]): Use bias or not. Default: ``True``
  
  Shape:
      - Input: :math:`(N, P, C_{in})` where :math:`N` is batch size, :math:`P` is number of patches,
      and :math:`C_{in}` is input embedding dim
      - Output: same shape as the input
code: def __init__(
      self,
      embed_dim: int,
      attn_dropout: Optional[float] = 0.0,
      bias: Optional[bool] = True,
      *args,
      **kwargs,
  ) -> None:
      super().__init__()
  
      self.qkv_proj = LinearLayer(
          in_features=embed_dim, out_features=3 * embed_dim, bias=bias
      )
  
      self.attn_dropout = Dropout(p=attn_dropout)
      self.out_proj = LinearLayer(
          in_features=embed_dim, out_features=embed_dim, bias=bias
      )
  
      self.softmax = nn.Softmax(dim=-1)
      self.embed_dim = embed_dim
      self.scaling = self.embed_dim**-0.5
  
file_path: ml-cvnets/cvnets/layers/single_head_attention.py
imports: from typing import Optional
  import torch
  from torch import Tensor, nn
  from torch.nn import functional
  from cvnets.layers.base_layer import BaseLayer
  from cvnets.layers.dropout import Dropout
  from cvnets.layers.linear_layer import LinearLayer
label_desc: Use image node_id 1 to create a new SingleHeadAttention object from inherited base classes: BaseLayer with example: obj = SingleHeadAttention(embed_dim, attn_dropout, bias)