Created
May 4, 2022 07:09
-
-
Save YunghuiHsu/3dbfd9cf4ebcaa694737e873fe07dac4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # caculate loss (forrward) | |
| start_forward = time.time() | |
| outputs = model(samples) | |
| loss = criterion(outputs, targets) | |
| end = time.time() | |
| # caculate loss (forrward) & log time | |
| torch.cuda.synchronize() | |
| start_forward = time.time() | |
| outputs = model(samples) | |
| loss = criterion(outputs, targets) | |
| torch.cuda.synchronize() | |
| end = time.time() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment