code: def __init__(
      self, hidden_size, num_heads, attention_dropout_rate, vis
  ):
      super(Attention, self).__init__()
      self.vis = vis
      self.num_attention_heads = num_heads
      self.attention_head_size = int(
          hidden_size / self.num_attention_heads
      )
      self.all_head_size = (
          self.num_attention_heads * self.attention_head_size
      )
  
      self.query = nn.Linear(hidden_size, self.all_head_size)
      self.key = nn.Linear(hidden_size, self.all_head_size)
      self.value = nn.Linear(hidden_size, self.all_head_size)
  
      self.out = nn.Linear(hidden_size, hidden_size)
      self.attention_dropout = nn.Dropout(attention_dropout_rate)
      self.proj_dropout = nn.Dropout(attention_dropout_rate)
  
      self.softmax = nn.Softmax(axis=-1)
  
imports: import copy
  import math
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from medicalseg.cvlibs import manager
  from medicalseg.utils import load_pretrained_model
label_desc: Use image node_id 1 to create a new Attention object from inherited base classes: nn with example: obj = Attention(hidden_size, num_heads, attention_dropout_rate, vis)