The output look fine. Since CUDA calls are asynchronously, you won’t necessarily see a specific order of the print statements.
However, if looks like self.foo is now on different devices.
Are you getting any other error message now?