-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from skumra/release/0.2.0
Release/0.2.0
- Loading branch information
Showing
27 changed files
with
860 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
find logs/ -maxdepth 1 -type d | grep -v ^\\.$ | xargs -n 1 du -s | while read size name ; do if [ $size -le 10485 ] ; then echo rm -rf $name ; fi done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import logging | ||
|
||
import torch | ||
|
||
logging.basicConfig(level=logging.INFO) | ||
|
||
|
||
def get_device(force_cpu): | ||
# Check if CUDA can be used | ||
if torch.cuda.is_available() and not force_cpu: | ||
logging.info("CUDA detected. Running with GPU acceleration.") | ||
device = torch.device("cuda") | ||
elif force_cpu: | ||
logging.info("CUDA detected, but overriding with option '--cpu'. Running with only CPU.") | ||
device = torch.device("cpu") | ||
else: | ||
logging.info("CUDA is *NOT* detected. Running with only CPU.") | ||
device = torch.device("cpu") | ||
return device |
Oops, something went wrong.