-
Notifications
You must be signed in to change notification settings - Fork 193
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
Numpy sum imap #579
base: master
Are you sure you want to change the base?
Numpy sum imap #579
Conversation
* Enable transformation from map to imap for its arguments.
* Just like lists.
super(ConstMethodIntr, self).__init__( | ||
*combiners, | ||
argument_effects=(ReadEffect(),) * 12, **kwargs) | ||
*combiners, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we don't want to overwrite the value if it is explicitly set
f9cd426
to
0d0b381
Compare
There is an issue with this PR as numpy.sum on generator return the same generator. Reason is that numpy expression are not Lazy in numpy as numpy need to know the size of the generator to allocate memory. For this reason, replacing list with generator will never work on numpy functions. Of course, we may still want to replace some numpy call on list to numpy call to generator to avoid memory allocation. I see 2 solution:
Any better idea? Or should I just leave this PR as it can't be really applied? |
On Mon, Jun 27, 2016 at 12:55:06PM -0700, pbrunet wrote:
Isn't this similar to saying that if we have a 1D array, we cann turn |
WIP : I have to add some tests and do the itertools to numpy_expr transformation for others iterators like ifilter