Hello,
I am trying to speed up the PSO algorithm. I have two question, want can I do to speed up the following:

The creation of the particles;
The movement equation.



x = (xmax - xmin)*torch.rand(pop).dtype + xmin




vnext = wtorch.rand(pop).dtype + c1torch.rand(pop).dtype*(b - x) + c2torch.rand(pop).dtype(bg - x)


When I use dtype = torch.cuda.FloatTensor is slower then using dtype =torch.FloatTensor.
How can I speed up the math using the GPU?