code: def test_tsne_knn_parameters_sparse(
      type_knn_graph, input_type, method
  ):
      digits = tsne_datasets["digits"].data
  
      neigh = cuKNN(
          n_neighbors=DEFAULT_N_NEIGHBORS, metric="euclidean"
      ).fit(digits)
      knn_graph = neigh.kneighbors_graph(
          digits, mode="distance"
      ).astype("float32")
  
      if type_knn_graph == "cuml":
          knn_graph = cupyx.scipy.sparse.csr_matrix(knn_graph)
  
      if input_type == "cupy":
          sp_prefix = cupyx.scipy.sparse
      else:
          sp_prefix = scipy.sparse
  
      tsne = TSNE(
          n_components=2,
          n_neighbors=DEFAULT_N_NEIGHBORS,
          random_state=1,
          learning_rate_method="none",
          method=method,
          min_grad_norm=1e-12,
          perplexity=DEFAULT_PERPLEXITY,
      )
  
      new_data = sp_prefix.csr_matrix(scipy.sparse.csr_matrix(digits))
  
      Y = tsne.fit_transform(new_data, True, knn_graph)
      if input_type == "cupy":
          Y = Y.get()
      validate_embedding(digits, Y, 0.85)
  
      Y = tsne.fit_transform(new_data, True, knn_graph.tocoo())
      if input_type == "cupy":
          Y = Y.get()
      validate_embedding(digits, Y, 0.85)
  
      Y = tsne.fit_transform(new_data, True, knn_graph.tocsc())
      if input_type == "cupy":
          Y = Y.get()
      validate_embedding(digits, Y, 0.85)
  
imports: import pytest
  from sklearn.manifold import TSNE
  from sklearn import datasets
  from sklearn.manifold import trustworthiness
  from sklearn.datasets import make_blobs
  from sklearn.neighbors import NearestNeighbors
  from cuml.manifold import TSNE
  from cuml.neighbors import NearestNeighbors
  from cuml.metrics import pairwise_distances
  from cuml.testing.utils import array_equal, stress_param
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 9 for calling a global function with example usage: test_tsne_knn_parameters_sparse(type_knn_graph, input_type, method) without return types