class_docstr: Reversible Blocks for Reversible Vision Transformer and also
  for state-preserving blocks in Reversible MViT. See Section
  3.3.2 in paper for details.
class_docstr_tok: ["Reversible","Blocks","for","Reversible","Vision","Transformer","and","also","for","state-preserving","blocks","in","Reversible","MViT",".","See","Section","3.3.2","in","paper","for","details","."]
docstr: forward pass equations:
  Y_1 = X_1 + Attention(X_2), F = Attention
  Y_2 = X_2 + MLP(Y_1), G = MLP
docstr_tok: ["forward","pass","equations",":","Y_1","=","X_1","+","Attention","(","X_2",")",",","F","=","Attention","Y_2","=","X_2","+","MLP","(","Y_1",")",",","G","=","MLP"]
code: def forward(self, X_1, X_2):
      """
      forward pass equations:
      Y_1 = X_1 + Attention(X_2), F = Attention
      Y_2 = X_2 + MLP(Y_1), G = MLP
      """
  
      self.seed_cuda("attn")
      # Y_1 : attn_output
      f_X_2 = self.F(X_2)
  
      self.seed_cuda("droppath")
      f_X_2_dropped = drop_path(
          f_X_2, drop_prob=self.drop_path_rate, training=self.training
      )
  
      # Y_1 = X_1 + f(X_2)
      Y_1 = X_1 + f_X_2_dropped
  
      # free memory
      del X_1
  
      self.seed_cuda("FFN")
      g_Y_1 = self.G(Y_1)
  
      torch.manual_seed(self.seeds["droppath"])
      g_Y_1_dropped = drop_path(
          g_Y_1, drop_prob=self.drop_path_rate, training=self.training
      )
  
      # Y_2 = X_2 + g(Y_1)
      Y_2 = X_2 + g_Y_1_dropped
  
      del X_2
  
      return Y_1, Y_2
  
imports: import sys
  from functools import partial
  import torch
  from torch import nn
  from torch.autograd import Function
  from slowfast.models.attention import MultiScaleAttention, attention_pool
  from slowfast.models.common import Mlp, TwoStreamFusion, drop_path
  from slowfast.models.utils import round_width
label_desc: Use image node_id 3 for calling the ReversibleBlock obj's underlying member method code with example usage: obj.forward(X_1, X_2) and returns: Y_1,  Y_2