code: def test_merge_linears():
      _, traced = get_bert_model()
      transformation = MergeLinears()
      transformed = transformation(traced)
  
      self_attention_modules = [
          mod
          for mod in transformed.modules()
          if isinstance(mod, BertSelfAttention)
      ]
      for module in self_attention_modules:
          num_linears = sum(
              (
                  1 if isinstance(mod, torch.nn.Linear) else 0
                  for mod in module.modules()
              )
          )
          assert (
              num_linears == 1
          ), "there should be one linear layer in BertSelfAttention after merging"
  
      restored = transformation(transformed, reverse=True)
      self_attention_modules = [
          mod
          for mod in restored.modules()
          if isinstance(mod, BertSelfAttention)
      ]
      for module in self_attention_modules:
          num_linears = sum(
              (
                  1 if isinstance(mod, torch.nn.Linear) else 0
                  for mod in module.modules()
              )
          )
          assert (
              num_linears == 3
          ), "there should be three linear layers in BertSelfAttention after the reverse transformation"
  
imports: import operator
  import unittest
  import torch
  from parameterized import parameterized
  from transformers import AutoModel, AutoModelForImageClassification, AutoTokenizer, BertModel
  from transformers.models.bert.modeling_bert import BertSelfAttention
  from transformers.utils.fx import symbolic_trace
  from optimum.fx.optimization import ChangeTrueDivToMulByInverse, FuseBatchNorm1dInLinear, FuseBatchNorm2dInConv2d, FuseBiasInLinear, MergeLinears, ReversibleTransformation, Transformation, compose
  from optimum.fx.utils import are_fx_features_available
label_desc: Use image node_id 2 for calling a global function with example usage: test_merge_linears() without return types