We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 533531f commit 63c0142Copy full SHA for 63c0142
beginner_source/basics/buildmodel_tutorial.py
@@ -37,8 +37,8 @@
37
# `torch.cuda <https://pytorch.org/docs/stable/notes/cuda.html>`_ is available, else we
38
# continue to use the CPU.
39
40
-device = 'cuda' if torch.cuda.is_available() else 'cpu'
41
-print('Using {} device'.format(device))
+device = "cuda" if torch.cuda.is_available() else "cpu"
+print(f"Using {device} device")
42
43
##############################################
44
# Define the Class
beginner_source/basics/quickstart_tutorial.py
@@ -89,7 +89,7 @@
89
90
# Get cpu or gpu device for training.
91
device = "cuda" if torch.cuda.is_available() else "cpu"
92
-print("Using {} device".format(device))
93
94
# Define model
95
class NeuralNetwork(nn.Module):
0 commit comments