code: def window_reverse(windows, window_size: int, H: int, W: int):
      """
      将一个个window还原成一个feature map
      Args:
          windows: (num_windows*B, window_size, window_size, C)
          window_size (int): Window size(M)
          H (int): Height of image
          W (int): Width of image
  
      Returns:
          x: (B, H, W, C)
      """
      B = int(windows.shape[0] / (H * W / window_size / window_size))
      # reshape: [B*num_windows, Mh, Mw, C] -> [B, H//Mh, W//Mw, Mh, Mw, C]
      x = tf.reshape(
          windows,
          [
              B,
              H // window_size,
              W // window_size,
              window_size,
              window_size,
              -1,
          ],
      )
      # permute: [B, H//Mh, W//Mw, Mh, Mw, C] -> [B, H//Mh, Mh, W//Mw, Mw, C]
      # reshape: [B, H//Mh, Mh, W//Mw, Mw, C] -> [B, H, W, C]
      x = tf.transpose(x, [0, 1, 3, 2, 4, 5])
      x = tf.reshape(x, [B, H, W, -1])
      return x
  
imports: import tensorflow
  from tensorflow.keras import Model, layers, initializers
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: window_reverse(windows, window_size, H, W) and returns: x