code: def test_reversible_runs(config, device):
      # Build both a reversible and non-reversible model
      model_non_reversible = xFormer.from_config(
          xFormerConfig(_rev_config(config, False))
      ).to(device)
      model_reversible = xFormer.from_config(
          xFormerConfig(_rev_config(config, True))
      ).to(device)
  
      # Dummy inputs, test a forward
      inputs = (
          (torch.rand((BATCH, SEQ), device=device) * 10)
          .abs()
          .to(torch.int)
      )
      _ = model_non_reversible(inputs)
      _ = model_reversible(inputs)
  
file_path: xformers/tests/test_reversible.py
imports: import random
  import pytest
  import torch
  from xformers.factory.model_factory import xFormer, xFormerConfig
label_desc: Use image node_id 2 for calling a global function with example usage: test_reversible_runs(config, device) without return types