code: def test_cpu_gpu_conversion(model_class, from_gpu):
      model = model_class(use_gpu=from_gpu, factors=32)
      user_plays = get_checker_board(50)
      model.fit(user_plays)
      converted = model.to_cpu() if from_gpu else model.to_gpu()
      assert_allclose(
          model.recommend(0, user_plays[0]),
          converted.recommend(0, user_plays[0]),
          rtol=1e-3,
          atol=1e-3,
      )
  
file_path: implicit/tests/gpu_test.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from recommender_base_test import get_checker_board
  import implicit
label_desc: Use image node_id 5 for calling a global function with example usage: test_cpu_gpu_conversion(model_class, from_gpu) without return types