code: def benchmark(model_name, num_batches, batch_size, is_cuda, is_half):
      print("Loading model {}".format(model_name))
      if is_cuda:
          hf_model = AutoModel.from_pretrained(
              model_name,
              torch_dtype=torch.float16 if is_half else None,
              device_map="auto",
          ).eval()
      else:
          hf_model = AutoModel.from_pretrained(
              model_name, torch_dtype=torch.float16 if is_half else None
          ).eval()
  
      bt_model = BetterTransformer.transform(
          hf_model, keep_original_model=True
      )
  
      inputs = get_batch(batch_size, model_name)
      input_features = inputs["pixel_values"]
  
      if is_cuda:
          input_features = input_features.to(0)
  
      # Warmup
      _ = hf_model(input_features)
      torch.cuda.synchronize()
      _ = bt_model(input_features)
      torch.cuda.synchronize()
  
      total_hf_time = timing_cuda(hf_model, num_batches, input_features)
      total_bt_time = timing_cuda(bt_model, num_batches, input_features)
  
      return total_bt_time, total_hf_time
  
file_path: optimum/tests/benchmark/benchmark_bettertransformer_vit.py
imports: import argparse
  import requests
  import torch
  from PIL import Image
  from transformers import AutoFeatureExtractor, AutoModel
  from optimum.bettertransformer import BetterTransformer
label_desc: Use image node_id 4 for calling a global function with example usage: benchmark(model_name, num_batches, batch_size, is_cuda, is_half) and returns: total_bt_time,  total_hf_time