class_docstr: MobileViT block mentioned in MobileViT.
  
  Args:
      dim: input dimension of Transformer.
      depth: depth of Transformer.
      channel: input channel.
      kernel_size: kernel size.
      patch_size: patch size for folding and unfloding.
      mlp_dim: dimension of the FeedForward layer in Transformer.
      dropout: dropout ratio, defaults to 0.
class_docstr_tok: ["MobileViT","block","mentioned","in","MobileViT",".","Args",":","dim",":","input","dimension","of","Transformer",".","depth",":","depth","of","Transformer",".","channel",":","input","channel",".","kernel_size",":","kernel","size",".","patch_size",":","patch","size","for","folding","and","unfloding",".","mlp_dim",":","dimension","of","the","FeedForward","layer","in","Transformer",".","dropout",":","dropout","ratio",",","defaults","to","0","."]
code: def forward(self, x: Tensor) -> Tensor:
      y = x.clone()
  
      # Local representations
      x = self.conv1(x)
      x = self.conv2(x)
  
      b, d, h, w = x.shape
      nh, nw = h // self.ph, w // self.pw
  
      # Global representations
      # [b, d, h, w] -> [b * d * nh, nw, ph, pw]
      x = x.reshape(b * d * nh, self.ph, nw, self.pw).transpose(1, 2)
      # [b * d * nh, nw, ph, pw] -> [b, (ph pw), (nh nw), d]
      x = x.reshape(b, d, nh * nw, self.ph * self.pw).transpose(1, 3)
  
      x = self.transformer(x)
  
      # [b, (ph pw), (nh nw), d] -> [b * d * nh, nw, ph, pw]
      x = x.transpose(1, 3).reshape(b * d * nh, nw, self.ph, self.pw)
      # [b * d * nh, nw, ph, pw] -> [b, d, h, w]
      x = x.transpose(1, 2).reshape(b, d, h, w)
  
      # Fusion
      x = self.conv3(x)
      x = torch.cat((x, y), 1)
      x = self.conv4(x)
      return x
  
imports: from typing import Any, Dict, Tuple
  import torch
  from torch import nn
  from kornia.core import Module, Tensor
label_desc: Use image node_id 2 for calling the MobileViTBlock obj's underlying member method code with example usage: obj.forward(x) and returns: x