class_docstr: A basic Swin Transformer layer for one stage.
  
  Args:
      dim (int): Number of input channels.
      depth (int): Number of blocks.
      num_heads (int): Number of attention heads.
      window_size (int): Local window size.
      mlp_ratio (float): Ratio of mlp hidden dim to embedding dim.
      qkv_bias (bool, optional): If True, add a learnable bias to query, key, value. Default: True
      drop (float, optional): Dropout rate. Default: 0.0
      attn_drop (float, optional): Attention dropout rate. Default: 0.0
      drop_path (float | tuple[float], optional): Stochastic depth rate. Default: 0.0
      downsample (layer.Layer | None, optional): Downsample layer at the end of the layer. Default: None
class_docstr_tok: ["A","basic","Swin","Transformer","layer","for","one","stage",".","Args",":","dim","(","int",")",":","Number","of","input","channels",".","depth","(","int",")",":","Number","of","blocks",".","num_heads","(","int",")",":","Number","of","attention","heads",".","window_size","(","int",")",":","Local","window","size",".","mlp_ratio","(","float",")",":","Ratio","of","mlp","hidden","dim","to","embedding","dim",".","qkv_bias","(","bool",",","optional",")",":","If","True",",","add","a","learnable","bias","to","query",",","key",",","value",".","Default",":","True","drop","(","float",",","optional",")",":","Dropout","rate",".","Default",":","0.0","attn_drop","(","float",",","optional",")",":","Attention","dropout","rate",".","Default",":","0.0","drop_path","(","float","|","tuple","[","float","]",",","optional",")",":","Stochastic","depth","rate",".","Default",":","0.0","downsample","(","layer.Layer","|","None",",","optional",")",":","Downsample","layer","at","the","end","of","the","layer",".","Default",":","None"]
code: def call(self, x, H, W, training=None):
      attn_mask = self.create_mask(H, W)  # [nW, Mh*Mw, Mh*Mw]
      for blk in self.blocks:
          blk.H, blk.W = H, W
          x = blk(x, attn_mask, training=training)
  
      if self.downsample is not None:
          x = self.downsample(x, H, W)
          H, W = (H + 1) // 2, (W + 1) // 2
  
      return x, H, W
  
imports: import tensorflow
  from tensorflow.keras import Model, layers, initializers
  import numpy
label_desc: Use image node_id 3 for calling the BasicLayer obj's underlying member method code with example usage: obj.call(x, H, W, training) and returns: x,  H,  W