code: def forward(self, video):
      x = self.to_patch_embedding(video)
      b, f, n, _ = x.shape
  
      x = x + self.pos_embedding[:, :f, :n]
  
      if exists(self.spatial_cls_token):
          spatial_cls_tokens = repeat(
              self.spatial_cls_token, "1 1 d -> b f 1 d", b=b, f=f
          )
          x = torch.cat((spatial_cls_tokens, x), dim=2)
  
      x = self.dropout(x)
  
      x = rearrange(x, "b f n d -> (b f) n d")
  
      # attend across space
  
      x = self.spatial_transformer(x)
  
      x = rearrange(x, "(b f) n d -> b f n d", b=b)
  
      # excise out the spatial cls tokens or average pool for temporal attention
  
      x = (
          x[:, :, 0]
          if not self.global_average_pool
          else reduce(x, "b f n d -> b f d", "mean")
      )
  
      # append temporal CLS tokens
  
      if exists(self.temporal_cls_token):
          temporal_cls_tokens = repeat(
              self.temporal_cls_token, "1 1 d-> b 1 d", b=b
          )
  
          x = torch.cat((temporal_cls_tokens, x), dim=1)
  
      # attend across time
  
      x = self.temporal_transformer(x)
  
      # excise out temporal cls token or average pool
  
      x = (
          x[:, 0]
          if not self.global_average_pool
          else reduce(x, "b f d -> b d", "mean")
      )
  
      x = self.to_latent(x)
      return self.mlp_head(x)
  
imports: import torch
  from torch import nn
  from einops import rearrange, repeat, reduce
  from einops.layers.torch import Rearrange
label_desc: Use image node_id 2 for calling the ViT obj's underlying member method code with example usage: obj.forward(video) and returns: self