how to check if a variable is cuda 0 or cpu in pytorch code example Example: how to check weather my model is on gpu in pytorch next(network.parameters()).device