Skip to content

Commit

Permalink
Fix lint error with newer version of Black (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
briancpark authored Feb 1, 2024
1 parent 6d35516 commit b40f159
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ __pycache__
*.bbl
*.blg
*.aux
*.pdf

# NNI
experiments/
Expand Down
4 changes: 1 addition & 3 deletions final/final.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@
device = torch.device(
"mps"
if torch.backends.mps.is_available()
else "cuda"
if torch.cuda.is_available()
else "cpu"
else "cuda" if torch.cuda.is_available() else "cpu"
)

print("Using device:", device.type.upper())
Expand Down
4 changes: 1 addition & 3 deletions proj1/proj1.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
device = torch.device(
"mps"
if torch.backends.mps.is_available()
else "cuda"
if torch.cuda.is_available()
else "cpu"
else "cuda" if torch.cuda.is_available() else "cpu"
)

print("Using device:", device.type.upper())
Expand Down
4 changes: 1 addition & 3 deletions proj2/proj2.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
device = torch.device(
"mps"
if torch.backends.mps.is_available()
else "cuda"
if torch.cuda.is_available()
else "cpu"
else "cuda" if torch.cuda.is_available() else "cpu"
)

print("Using device:", device.type.upper())
Expand Down
4 changes: 1 addition & 3 deletions proj3/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
device = torch.device(
"mps"
if torch.backends.mps.is_available()
else "cuda"
if torch.cuda.is_available()
else "cpu"
else "cuda" if torch.cuda.is_available() else "cpu"
)

print("Using device:", device.type.upper())
Expand Down
4 changes: 1 addition & 3 deletions proj4/proj4.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
device = torch.device(
"mps"
if torch.backends.mps.is_available()
else "cuda"
if torch.cuda.is_available()
else "cpu"
else "cuda" if torch.cuda.is_available() else "cpu"
)

if not os.path.exists("logs"):
Expand Down

0 comments on commit b40f159

Please sign in to comment.