code: def _check_compose_works(self, inplace):
      _, traced = get_bert_model()
      transformed = MergeLinears()(
          ChangeTrueDivToMulByInverse()(traced)
      )
  
      _, traced = get_bert_model()
      composition = compose(
          ChangeTrueDivToMulByInverse(), MergeLinears(), inplace=inplace
      )
      transformed_with_composition = composition(traced)
  
      self.assertEqual(
          transformed.code, transformed_with_composition.code
      )
  
      restored = MergeLinears()(
          ChangeTrueDivToMulByInverse()(transformed, reverse=True),
          reverse=True,
      )
      restored_with_composition = composition(
          transformed_with_composition, reverse=True
      )
  
      self.assertEqual(restored.code, restored_with_composition.code)
  
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 5 for calling the TransformationTester obj's underlying member method code with example usage: obj._check_compose_works(inplace) without return types