class_docstr: dim:
  num_heads:
class_docstr_tok: ["dim",":","num_heads",":"]
code: def forward(
      self,
      x,
      einops_from_space,
      einops_to_space,
      einops_from_time,
      einops_to_time,
      time_n,
      space_f,
  ):
      if self.attention_style != "bridge_former":
          time_output = self.timeattn(
              self.norm3(x), einops_from_time, einops_to_time, n=time_n
          )
          time_residual = x + time_output
      else:
          time_residual = x
      space_output = self.attn(
          self.norm1(time_residual),
          einops_from_space,
          einops_to_space,
          f=space_f,
      )
      if self.attention_style in ["frozen_in_time", "bridge_former"]:
          space_residual = x + self.drop_path(space_output)
      else:
          raise NotImplementedError
  
      x = space_residual + self.drop_path(
          self.mlp(self.norm2(space_residual))
      )
  
      return x
  
imports: from collections import OrderedDict
  from functools import partial
  import torch
  from einops import rearrange, repeat
  from timm.models.layers import DropPath, trunc_normal_
  from torch import einsum, nn
  from towhee.models.layers.mlp import Mlp
  from towhee.models.layers.patch_embed2d import PatchEmbed2D
  from towhee.models.utils.init_vit_weights import init_vit_weights
  import logging
label_desc: Use image node_id 2 for calling the SpaceTimeBlock obj's underlying member method code with example usage: obj.forward(x, einops_from_space, einops_to_space, einops_from_time, einops_to_time, time_n, space_f) and returns: x