code: def test_tsne_fit_transform_on_digits_sparse(input_type, method):
      digits = tsne_datasets["digits"].data
  
      if input_type == "cupy":
          sp_prefix = cupyx.scipy.sparse
      else:
          sp_prefix = scipy.sparse
  
      fitter = TSNE(
          n_components=2,
          random_state=1,
          method=method,
          min_grad_norm=1e-12,
          n_neighbors=DEFAULT_N_NEIGHBORS,
          learning_rate_method="none",
          perplexity=DEFAULT_PERPLEXITY,
      )
  
      new_data = sp_prefix.csr_matrix(
          scipy.sparse.csr_matrix(digits)
      ).astype("float32")
  
      embedding = fitter.fit_transform(new_data, convert_dtype=True)
  
      if input_type == "cupy":
          embedding = embedding.get()
  
      trust = trustworthiness(
          digits, embedding, n_neighbors=DEFAULT_N_NEIGHBORS
      )
      assert trust >= 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 8 for calling a global function with example usage: test_tsne_fit_transform_on_digits_sparse(input_type, method) without return types