mrshenli:

_xy(superpixels, self.imsize[0], self.imsize[1])


Thanks for helping. wait_stream 1 is necessary in my case.  I could use torch.cuda.synchronize() to check which way is better for implementation.