    def forward(self, q, v, size):
        """forward function"""
        _, h, _, _ = q.shape
        hh, ww = size

        # We don"t use CLS_TOKEN
        q_img = q
        v_img = v

        # Shape: [bb, h, hh*ww, ch] -> [bb, h*ch, hh, ww].
        v_img = rearrange(v_img, "bb h (hh ww) ch -> bb (h ch) hh ww", hh=hh, ww=ww)
        # Split according to channels.
        v_img_list = torch.split(v_img, self.channel_splits, dim=1)
        conv_v_img_list = [
            conv(x) for conv, x in zip(self.conv_list, v_img_list)
        ]
        conv_v_img = torch.cat(conv_v_img_list, dim=1)
        # Shape: [bb, h*ch, hh, ww] -> [bb, h, hh*ww, ch].
        conv_v_img = rearrange(conv_v_img, "bb (h ch) hh ww -> bb h (hh ww) ch", h=h)

        ev_hat_img = q_img * conv_v_img
        ev_hat = ev_hat_img
        return ev_hat
forward function
towhee/models/mpvit/mpvit.py