Skip to content

Instantly share code, notes, and snippets.

@dantegd
Created April 28, 2020 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dantegd/e3d75762b903b6104dc124ff55d523b4 to your computer and use it in GitHub Desktop.
Save dantegd/e3d75762b903b6104dc124ff55d523b4 to your computer and use it in GitHub Desktop.
Usage of cuML's set_global_output_type
import cupy as cp
import numpy as np
import cuml
cuml.set_global_output_type('numpy')
ary = cp.array([[1.0, 4.0, 4.0], [2.0, 2.0, 2.0], [5.0, 1.0, 1.0]])
kmeans = cuml.KMeans(n_clusters=2)
kmeans.fit(ary)
print(type(kmeans.labels_))
# <class 'numpy.ndarray'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment