Thanks. I think I will do that.
I was trying to avoid doing it since it is running in the gpu but I guess it is fine.
My goal is to implement knn and this section of the code is meant to count the votes of the labels