class_docstr: `BetterTransformersTestMixin` to wrap necessary functions for testing `BetterTransformer`
  integration. This includes the following tests:
      - `test_logits`: This tests if the converted model produces the same logits
      than the original model.
      - `test_raise_on_save`: Test if the converion properly raises an error if someone tries to save the model using `save_pretrained`.
class_docstr_tok: ["`","BetterTransformersTestMixin","`","to","wrap","necessary","functions","for","testing","`","BetterTransformer","`","integration",".","This","includes","the","following","tests",":","-","`","test_logits","`",":","This","tests","if","the","converted","model","produces","the","same","logits","than","the","original","model",".","-","`","test_raise_on_save","`",":","Test","if","the","converion","properly","raises","an","error","if","someone","tries","to","save","the","model","using","`","save_pretrained","`","."]
code: def assert_equal(
      self, tensor1, tensor2, atol: float, model_name: str
  ):
      self.assertTrue(
          torch.allclose(tensor1, tensor2, atol=atol),
          f"The BetterTransformer converted model does not produce the same logits as the original model. Failed for the model {model_name}."
          f" Maxdiff: {torch.abs(tensor1 - tensor2).max()}",
      )
  
imports: import copy
  import inspect
  import tempfile
  import unittest
  import torch
  from transformers import AutoModel
  from optimum.bettertransformer import BetterTransformer
  from optimum.utils.testing_utils import flatten_dict, require_torch_gpu
label_desc: Use image node_id 5 for calling the BetterTransformersTestMixin obj's underlying member method code with example usage: obj.assert_equal(tensor1, tensor2, atol, model_name) without return types