class_docstr: Full testing suite of the `BetterTransformers` integration into Hugging Face
  `transformers` ecosystem. Check the docstring of each test to understand the
  purpose of each test. Basically we test:
  - if the conversion dictionnary is consistent, ie if the converted model exists
  in HuggingFace `transformers` library.
  - if the converted model produces the same logits as the original model.
  - if the converted model is faster than the original model.
class_docstr_tok: ["Full","testing","suite","of","the","`","BetterTransformers","`","integration","into","Hugging","Face","`","transformers","`","ecosystem",".","Check","the","docstring","of","each","test","to","understand","the","purpose","of","each","test",".","Basically","we","test",":","-","if","the","conversion","dictionnary","is","consistent",",","ie","if","the","converted","model","exists","in","HuggingFace","`","transformers","`","library",".","-","if","the","converted","model","produces","the","same","logits","as","the","original","model",".","-","if","the","converted","model","is","faster","than","the","original","model","."]
docstr: Test if the converion properly raises an error if the model has an activate function that is
  not supported by `BetterTransformer`. For now, only `Bert` family model support this test.
docstr_tok: ["Test","if","the","converion","properly","raises","an","error","if","the","model","has","an","activate","function","that","is","not","supported","by","`","BetterTransformer","`",".","For","now",",","only","`","Bert","`","family","model","support","this","test","."]
code: def test_raise_pos_emb(self):
      r"""
      Test if the converion properly raises an error if the model has an activate function that is
      not supported by `BetterTransformer`. For now, only `Bert` family model support this test.
      """
      random_config = getattr(transformers, "BertConfig")()
      random_config.position_embedding_type = "relative"
  
      with self.assertRaises(ValueError):
          hf_model = AutoModel.from_config(random_config).eval()
          _ = BetterTransformer.transform(
              hf_model, keep_original_model=False
          )
  
imports: import gc
  import timeit
  import pytest
  import torch
  import transformers
  from parameterized import parameterized
  from testing_utils import MODELS_DICT, BetterTransformersTestMixin
  from transformers import AutoModel, AutoProcessor, AutoTokenizer
  from optimum.bettertransformer import BetterTransformer
  from optimum.pipelines import pipeline
  from optimum.utils.testing_utils import grid_parameters, require_accelerate, require_torch_gpu
label_desc: Use image node_id 3 for calling the BetterTransformersEncoderTest obj's underlying member method code with example usage: obj.test_raise_pos_emb() without return types