class_docstr: Transformer for clip
  Args:
      width (int): width
      layers (int): number of layers
      heads (int): number of heads
      attn_mask (Union[torch.Tensor, Callable]): attention mask
      vis (bool): visualization
      patch_nums (int): number of patches
      is_bridge_former_video (bool): text transformer or visual transformer for a single frame
code: def __init__(
      self,
      width: int,
      layers: int,
      heads: int,
      attn_mask: Union[torch.Tensor, Callable] = None,
      vis: bool = False,
      patch_nums: int = None,
      is_bridge_former_video: bool = False,
  ):
      super().__init__()
      self.width = width
      self.layers = layers
      self.resblocks = nn.Sequential(
          *[
              ResidualAttentionBlock(
                  width,
                  heads,
                  attn_mask,
                  vis,
                  patch_nums=patch_nums,
                  is_bridge_former_video=is_bridge_former_video,
              )
              for _ in range(layers)
          ]
      )
  
imports: import os
  import warnings
  from collections import OrderedDict
  from typing import Tuple, Union, Callable
  import numpy
  from PIL import Image
  import torch
  from torch import nn
  from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize
  from towhee.models.utils.download import download_from_url
  from towhee.models.clip.clip_utils import get_configs, convert_weights, patch_device, patch_float, tokenize
  from towhee.models.clip.auxilary import multi_head_attention_forward, MultiheadAttention
label_desc: Use image node_id 1 to create a new Transformer object from inherited base classes: nn with example: obj = Transformer(width, layers, heads, attn_mask, vis, patch_nums, is_bridge_former_video)