code: def test_benchmark_function(case, optimizer_config):
      func, initial_state, min_loc = case
      optimizer_class, config, iterations = optimizer_config
  
      x = torch.Tensor(initial_state).requires_grad_(True)
      x_min = torch.Tensor(min_loc)
      optimizer = optimizer_class([x], **config)
      for _ in range(iterations):
          optimizer.zero_grad()
          f = func(x)
          f.backward(retain_graph=True, create_graph=True)
          optimizer.step()
      assert torch.allclose(x, x_min, atol=0.001)
  
      name = optimizer.__class__.__name__
      assert name in optimizer.__repr__()
  
file_path: pytorch-optimizer/tests/test_basic.py
imports: import pytest
  import torch
  import torch_optimizer
label_desc: Use image node_id 6 for calling a global function with example usage: test_benchmark_function(case, optimizer_config) without return types