Tesla Interview Question

Given image tensors, decompose them into patches and implement the Kmeans algorithm to cluster it. Using numpy and also need to implement a convergence criterion. Need to convert data type from uint8 to float.