class_docstr: Reversible model builder. This builds the reversible transformer encoder
  and allows reversible training.
  
  Karttikeya Mangalam, Haoqi Fan, Yanghao Li, Chao-Yuan Wu, Bo Xiong,
  Christoph Feichtenhofer, Jitendra Malik
  "Reversible Vision Transformers"
  
  https://openaccess.thecvf.com/content/CVPR2022/papers/Mangalam_Reversible_Vision_Transformers_CVPR_2022_paper.pdf
class_docstr_tok: ["Reversible","model","builder",".","This","builds","the","reversible","transformer","encoder","and","allows","reversible","training",".","Karttikeya","Mangalam",",","Haoqi","Fan",",","Yanghao","Li",",","Chao-Yuan","Wu",",","Bo","Xiong",",","Christoph","Feichtenhofer",",","Jitendra","Malik","''","Reversible","Vision","Transformers","''","https",":","\/\/openaccess.thecvf.com\/content\/CVPR2022\/papers\/Mangalam_Reversible_Vision_Transformers_CVPR_2022_paper.pdf"]
docstr: Using rev layers without rev backpropagation. Debugging purposes only.
  Activated with self.no_custom_backward.
docstr_tok: ["Using","rev","layers","without","rev","backpropagation",".","Debugging","purposes","only",".","Activated","with","self.no_custom_backward","."]
code: def vanilla_backward(h, layers, buffer):
      """
      Using rev layers without rev backpropagation. Debugging purposes only.
      Activated with self.no_custom_backward.
      """
  
      # split into hidden states (h) and attention_output (a)
      h, a = torch.chunk(h, 2, dim=-1)
      for _, layer in enumerate(layers):
          a, h = layer(a, h)
  
      return torch.cat([a, h], dim=-1)
  
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 2 for calling the ReversibleMViT obj's underlying member method code with example usage: obj.vanilla_backward(h, layers, buffer) and returns: torch