class_docstr: Vanilla transformer block from the original paper "Attention is all you need"
  Detailed analysis: https://theaisummer.com/transformer/
class_docstr_tok: ["Vanilla","transformer","block","from","the","original","paper","``","Attention","is","all","you","need","''","Detailed","analysis",":","https",":","\/\/theaisummer.com\/transformer\/"]
code: def forward(self, x, mask=None):
      if self.prenorm:
          y = self.drop(self.mhsa(self.norm_1(x), mask)) + x
          out = self.linear(self.norm_2(y)) + y
      else:
          y = self.norm_1(self.drop(self.mhsa(x, mask)) + x)
          out = self.norm_2(self.linear(y) + y)
      return out
  
imports: from typing import List, Tuple
  import numpy
  import paddle
  import paddle.nn
  from paddle import Tensor
  from medicalseg.cvlibs import manager
label_desc: Use image node_id 2 for calling the TransformerBlock obj's underlying member method code with example usage: obj.forward(x, mask) and returns: out