print("CUDA available: ", torch.cuda.is_available())
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

CUDA available:  True
x = torch.tensor([1, 2, 3]).to(device)
y = torch.tensor([1, 2, 3])

%%timeit -n 10000
z = x + 1

10000 loops, best of 3: 15.6 µs per loop
%%timeit -n 10000
z = y + 1

10000 loops, best of 3: 5.19 µs per loop