Skip to content

Instantly share code, notes, and snippets.

@Hanrui-Wang
Created July 18, 2019 00:42
Show Gist options
  • Save Hanrui-Wang/e5384ffd3dae858ebee8b1264b496210 to your computer and use it in GitHub Desktop.
Save Hanrui-Wang/e5384ffd3dae858ebee8b1264b496210 to your computer and use it in GitHub Desktop.
make full use of .format
print ('Epoch [{0:<10d}/{1:>10d}], Loss: {2:=^20.4f}'.format(epoch+1, num_epochs, loss.item()))
# Epoch [10 / 60], Loss: =======2.5578=======
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment