Parallel computation using cpu and gpu

epe = self.checker(image[2].cpu())
image[0] = torch.sigmoid(image[0])
image[1] = torch.sigmoid(image[1])
image[2] = torch.sigmoid(image[2])

Is it possible to achieve parallel CPU and GPU compuation in pytorch?

I hope to calculate the epe with CPU. Epe is a metric of the image and it includes multiple for loop operations, difficult to parrallel. As for later operations, they can be calculated with gpu. The images are stored with torch.tensor. My question is whether is it possible to achieve cpu and gpu computation parallelly since the epe will not change the image[2] and the later operations.

GPU operations are asynchronous so any layer or model that has a .cuda() will run on GPU