code: def forward(self, hidden_states):
      mixed_query_layer = self.query(hidden_states)
      mixed_key_layer = self.key(hidden_states)
      mixed_value_layer = self.value(hidden_states)
  
      query_layer = self.transpose_for_scores(mixed_query_layer)
      key_layer = self.transpose_for_scores(mixed_key_layer)
      value_layer = self.transpose_for_scores(mixed_value_layer)
  
      attention_scores = paddle.matmul(
          query_layer, key_layer.transpose([0, 1, 3, 2])
      )
      attention_scores = attention_scores / math.sqrt(
          self.attention_head_size
      )
      attention_probs = self.softmax(attention_scores)
      weights = attention_probs if self.vis else None
      attention_probs = self.attention_dropout(attention_probs)
  
      context_layer = paddle.matmul(attention_probs, value_layer)
      context_layer = context_layer.transpose([0, 2, 1, 3])
      new_context_layer_shape = list(context_layer.shape[:-2]) + [
          self.all_head_size
      ]
      context_layer = context_layer.reshape(new_context_layer_shape)
      attention_output = self.out(context_layer)
      attention_output = self.proj_dropout(attention_output)
      return attention_output, weights
  
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 3 for calling the Attention obj's underlying member method code with example usage: obj.forward(hidden_states) and returns: attention_output,  weights