viz.analysis.KMeans.destroy
KMeans.destroy(): voidClean up GPU resources.
Releases WebGPU compute pipelines and bind group layouts. Call this when done with clustering to free GPU memory. Only needed if reusing KMeans instance; single-use clustering should use the kmeans convenience function instead.
Examples
const km = new KMeans();
const result1 = await km.fit(data1, shape1, { k: 5 });
const result2 = await km.fit(data2, shape2, { k: 5 });
km.destroy(); // After done with all clustering