code: def __init__(self, d_input, d_attn, n_heads, dropout_prob):
      super(AtnPool, self).__init__()
      self.d_head = d_attn // n_heads
      self.d_head_output = d_input // n_heads
      self.num_heads = n_heads
  
      def _init(tensor_):
          tensor_.data = truncated_normal_fill(
              tensor_.data.shape, std=0.01
          )
  
      w1_head = torch.zeros(n_heads, d_input, self.d_head)
      b1_head = torch.zeros(n_heads, self.d_head)
      w2_head = torch.zeros(n_heads, self.d_head, self.d_head_output)
      b2_head = torch.zeros(n_heads, self.d_head_output)
      _init(w1_head)
      _init(b1_head)
      _init(w2_head)
      _init(b2_head)
      self.genpool_w1_head = nn.Parameter(w1_head, requires_grad=True)
      self.genpool_b1_head = nn.Parameter(b1_head, requires_grad=True)
      self.genpool_w2_head = nn.Parameter(w2_head, requires_grad=True)
      self.genpool_b2_head = nn.Parameter(b2_head, requires_grad=True)
      self.activation = nn.GELU()
      self.dropout1 = nn.Dropout(dropout_prob)
      self.dropout2 = nn.Dropout(dropout_prob)
      self.dropout3 = nn.Dropout(dropout_prob)
      self.softmax = nn.Softmax(dim=2)
      self.softmax_temp = 1
      self.genpool_one = nn.Parameter(
          torch.ones(1), requires_grad=False
      )
  
imports: from collections import OrderedDict
  import os
  import numpy
  import torch
  from torch import nn
  from gluoncv.torch.utils.coot_utils import truncated_normal_fill
label_desc: Use image node_id 1 to create a new AtnPool object from inherited base classes: nn with example: obj = AtnPool(d_input, d_attn, n_heads, dropout_prob)