Cosmetic improvements to code#215
Cosmetic improvements to code#215lukemelas merged 3 commits intolukemelas:masterfrom chrisyeh96:linting
Conversation
| output: Output after drop connection. | ||
| """ | ||
| assert p >= 0 and p <= 1, 'p must be in range of [0,1]' | ||
| assert 0 <= p <= 1, 'p must be in range of [0,1]' |
There was a problem hiding this comment.
Python has supported chained comparisons since at least version Python 3.0
|
Thanks for the PR! I'll definitely merge the cosmetic changes and I think the use of I love f-strings, but I think I'll likely keep the |
1) Use PyTorch's own nn.Identity() function. 2) Update minimum Python version to 3.6 because of the use of f-strings. 3) Remove excess whitespace
|
@lukemelas There were a few places in the repo where you were already using f-strings, which is why I thought to continue using them. However, I agree that supporting Python 3.5 is also good to do for now. I went ahead and replaced all of the instances of f-strings with |
Cosmetic improvements to code
nn.Identity()function, available since PyTorch v1.1.0, instead of a duplicate implementation.2) Update minimum Python version to 3.6 because of the use of f-strings.(see discussion below)