Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace async with non_blocking for Python 3.7 #25

Closed
wants to merge 3 commits into from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jul 27, 2018

async is now a reserved word in Python >= 3.7 so use non_blocking instead. pytorch/pytorch#4999

flake8 testing of https://github.com/quark0/darts on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./cnn/train.py:119:40: E999 SyntaxError: invalid syntax
    target = Variable(target).cuda(async=True)
                                       ^
./cnn/train_imagenet.py:176:30: E999 SyntaxError: invalid syntax
    target = target.cuda(async=True)
                             ^
./cnn/train_search.py:145:61: E999 SyntaxError: invalid syntax
    target = Variable(target, requires_grad=False).cuda(async=True)
                                                            ^
3     E999 SyntaxError: invalid syntax
3

@alphadl
Copy link

alphadl commented Jul 25, 2019

Thx, it works for me~

@cclauss cclauss closed this Feb 14, 2020
@cclauss cclauss deleted the patch-1 branch February 14, 2020 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants