code: def test_logits_to_logprobs(
      size_and_axis, convert_to_list: bool, atol: float = 1e-7
  ):
      size, axis = size_and_axis
      logits: np.ndarray = -np.random.uniform(low=0, high=60, size=size)
      logits = logits.astype(np.single)
      if convert_to_list:
          # Currently, logits are converted from arrays to lists. This may change soon
          logits = logits.tolist()
      log_probs = llama_cpp.Llama.logits_to_logprobs(logits, axis=axis)
      log_probs_correct = log_softmax(logits, axis=axis)
      assert log_probs.dtype == np.single
      assert log_probs.shape == size
      assert np.allclose(log_probs, log_probs_correct, atol=atol)
  
file_path: llama-cpp-python/tests/test_llama.py
imports: import ctypes
  import numpy
  import pytest
  from scipy.special import log_softmax
  import llama_cpp
label_desc: Use image node_id 7 for calling a global function with example usage: test_logits_to_logprobs(size_and_axis, convert_to_list, atol) without return types