Skip to content
New issue

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

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

Already on GitHub? # to your account

"name 'ifilterfalse' is not defined" in Python3 #15

Closed
mxwell opened this issue Nov 10, 2018 · 3 comments
Closed

"name 'ifilterfalse' is not defined" in Python3 #15

mxwell opened this issue Nov 10, 2018 · 3 comments

Comments

@mxwell
Copy link

mxwell commented Nov 10, 2018

Hi,
I've tried to run PyTorch implementation in Python 3.6 and got the error:

    226     l = iter(l)
    227     if ignore_nan:
--> 228         l = ifilterfalse(isnan, l)
    229     try:
    230         n = 1

NameError: name 'ifilterfalse' is not defined

I think the function needs to be aliased after import in Python 3 like this:

from itertools import filterfalse as filterfalse
@bermanmaxim
Copy link
Owner

I suppose you meant from itertools import filterfalse as ifilterfalse. That is correct. I'm open to a PR if you want to send one. Cheers, Maxim

@mdsalnikov
Copy link
Contributor

#16
PR for solving this problem.

@bermanmaxim
Copy link
Owner

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants