class_docstr: CLIP4Clip model from the paper: https://arxiv.org/abs/2104.08860
  Only meanP and 2d type reserved because of its performance.
  Args:
      embed_dim (`int`):
          Embedding dimension.
      image_resolution (`int`):
          Image resolution.
      vision_layers (`int`):
          Number of layers for vision.
      vision_width (`int`):
          Width for vision.
      vision_patch_size (`int`):
          Patch size for vision.
      context_length (`int`):
          Length of context.
      vocab_size (`int`):
          Vocabulary size.
      transformer_width (`int`):
          Width for transformer.
      transformer_heads (`int`):
          Number of heads for transformer.
      transformer_layers (`int`):
          Number of layers for transformer size.
class_docstr_tok: ["CLIP4Clip","model","from","the","paper",":","https",":","\/\/arxiv.org\/abs\/2104.08860","Only","meanP","and","2d","type","reserved","because","of","its","performance",".","Args",":","embed_dim","(","`","int","`",")",":","Embedding","dimension",".","image_resolution","(","`","int","`",")",":","Image","resolution",".","vision_layers","(","`","int","`",")",":","Number","of","layers","for","vision",".","vision_width","(","`","int","`",")",":","Width","for","vision",".","vision_patch_size","(","`","int","`",")",":","Patch","size","for","vision",".","context_length","(","`","int","`",")",":","Length","of","context",".","vocab_size","(","`","int","`",")",":","Vocabulary","size",".","transformer_width","(","`","int","`",")",":","Width","for","transformer",".","transformer_heads","(","`","int","`",")",":","Number","of","heads","for","transformer",".","transformer_layers","(","`","int","`",")",":","Number","of","layers","for","transformer","size","."]
code: def get_visual_output(self, video, video_mask, shaped=False):
      if shaped is False:
          video_mask = video_mask.view(-1, video_mask.shape[-1])
          video = torch.as_tensor(video).float()
          b, pair, bs, ts, channel, h, w = video.shape
          video = video.view(b * pair * bs * ts, channel, h, w)
  
      bs_pair = video_mask.size(0)
      visual_hidden = self.clip.encode_image(video).float()
      visual_hidden = visual_hidden.view(
          bs_pair, -1, visual_hidden.size(-1)
      )
  
      return visual_hidden
  
imports: import torch
  import logging
  from typing import Union
  from torch import nn
  from towhee.models.clip4clip.until_module import PreTrainedModel, CrossEn
  from towhee.models.clip import CLIP, get_configs
label_desc: Use image node_id 4 for calling the CLIP4Clip obj's underlying member method code with example usage: obj.get_visual_output(video, video_mask, shaped) and returns: visual_hidden