class_docstr: Window based multi-head self attention (W-MSA) module with relative position bias.
  It supports both of shifted and non-shifted window.
  Args:
      dim (int): Number of input channels.
      window_size (tuple[int]): The height and width of the window.
      num_heads (int): Number of attention heads.
      qkv_bias (bool, optional):  If True, add a learnable bias to query, key, value. Default: True
      qk_scale (float | None, optional): Override default qk scale of head_dim ** -0.5 if set
      attn_drop (float, optional): Dropout ratio of attention weight. Default: 0.0
      proj_drop (float, optional): Dropout ratio of output. Default: 0.0
class_docstr_tok: ["Window","based","multi-head","self","attention","(","W-MSA",")","module","with","relative","position","bias",".","It","supports","both","of","shifted","and","non-shifted","window",".","Args",":","dim","(","int",")",":","Number","of","input","channels",".","window_size","(","tuple","[","int","]",")",":","The","height","and","width","of","the","window",".","num_heads","(","int",")",":","Number","of","attention","heads",".","qkv_bias","(","bool",",","optional",")",":","If","True",",","add","a","learnable","bias","to","query",",","key",",","value",".","Default",":","True","qk_scale","(","float","|","None",",","optional",")",":","Override","default","qk","scale","of","head_dim","*","*","-0.5","if","set","attn_drop","(","float",",","optional",")",":","Dropout","ratio","of","attention","weight",".","Default",":","0.0","proj_drop","(","float",",","optional",")",":","Dropout","ratio","of","output",".","Default",":","0.0"]
code: def compute_macs(module, input, output):
      B, N, C = input[0].shape
  
      module.__flops__ += module.flops(N) * B
  
imports: import os
  import logging
  import torch
  import torch.nn
  import torch.nn.functional
  from functools import partial
  import torch.distributed
  from torch.nn.init import trunc_normal_
  from megatron.model.transformer import DropPath
  from megatron import get_args
  from megatron.model import LayerNorm
  import numpy
  from math import sqrt
label_desc: Use image node_id 5 for calling the WindowAttention obj's underlying member method code with example usage: obj.compute_macs(module, input, output) without return types