class_docstr: Base class for MF models running on the GPU.
  
  This adds support for inference to run on the GPU as well as training.
  
  Attributes
  ----------
  item_factors : implicit.gpu.Matrix
      Array of latent factors for each item in the training set
  user_factors : implicit.gpu.Matrix
      Array of latent factors for each user in the training set
code: def similar_items(
      self,
      itemid,
      N=10,
      recalculate_item=False,
      item_users=None,
      filter_items=None,
      items=None,
  ):
      item_factors = self.item_factors
      norms = self.item_norms
      if items is not None:
          if filter_items:
              raise ValueError(
                  "Can't set both items and filter_items in similar_items call"
              )
  
          items = np.array(items)
  
          # TODO: we should be able to do this all on the GPU
          norms = implicit.gpu.Matrix(
              self._item_norms_host[items].reshape(1, len(items))
          )
          item_factors = item_factors[items]
  
          # check selected items are in the model
          if (
              items.max() >= self.item_factors.shape[0]
              or items.min() < 0
          ):
              raise IndexError("Some itemids are not in the model")
  
      if recalculate_item:
          query_factors = self.recalculate_item(itemid, item_users)
      else:
          query_factors = self.item_factors[itemid]
  
      if filter_items is not None:
          filter_items = implicit.gpu.IntVector(
              np.array(filter_items, dtype="int32")
          )
  
      ids, scores = self.knn.topk(
          item_factors,
          query_factors,
          N,
          norms,
          item_filter=filter_items,
      )
  
      if items is not None:
          ids = items[ids]
  
      item_norms = self._item_norms_host[itemid]
      if np.isscalar(itemid):
          ids, scores = ids[0], scores[0]
          scores /= item_norms
      else:
          scores /= item_norms[:, None]
      return ids, scores
  
imports: import time
  import numpy
  from scipy.sparse import csr_matrix
  import implicit.gpu
  from ..cpu.matrix_factorization_base import _filter_items_from_sparse_matrix
  from ..recommender_base import RecommenderBase
label_desc: Use image node_id 7 for calling the MatrixFactorizationBase obj's underlying member method code with example usage: obj.similar_items(itemid, N, recalculate_item, item_users, filter_items, items) and returns: ids,  scores