Skip to content

Commit 2f68be0

Browse files
Upgrade to f-strings (#1806)
For consistency Co-authored-by: Holly Sweeney <[email protected]>
1 parent 6cd0e06 commit 2f68be0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

beginner_source/basics/buildmodel_tutorial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
# `torch.cuda <https://pytorch.org/docs/stable/notes/cuda.html>`_ is available, else we
3838
# continue to use the CPU.
3939

40-
device = 'cuda' if torch.cuda.is_available() else 'cpu'
41-
print(f'Using {device} device')
40+
device = "cuda" if torch.cuda.is_available() else "cpu"
41+
print(f"Using {device} device")
4242

4343
##############################################
4444
# Define the Class
@@ -181,7 +181,7 @@ def forward(self, x):
181181
#
182182

183183

184-
print("Model structure: ", model, "\n\n")
184+
print(f"Model structure: {model}\n\n")
185185

186186
for name, param in model.named_parameters():
187187
print(f"Layer: {name} | Size: {param.size()} | Values : {param[:2]} \n")

0 commit comments

Comments
 (0)