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

boolean indexing giving faulty results #68

Closed
ZacDiggum opened this issue Mar 17, 2016 · 1 comment
Closed

boolean indexing giving faulty results #68

ZacDiggum opened this issue Mar 17, 2016 · 1 comment
Labels
Milestone

Comments

@ZacDiggum
Copy link
Contributor

Consider this:

a = af.constant(0., d0=3, d1=3)
a[1,1] = 1.

This one makes the whole second row into 2s:
a[a>0.] = 2.
While pavanky's trick gives the correct result:

cond = a>0
a = a*(1-cond)+cond*2.

Update: this also gives wrong results:
a[af.algorithm.where(a>0.)] = 2.

@pavanky pavanky added this to the 3.3 milestone Mar 20, 2016
@pavanky
Copy link
Member

pavanky commented Mar 20, 2016

@ZacDiggum This should be fixed in devel. Let me know if the problem still persists.

@pavanky pavanky closed this as completed Mar 20, 2016
@pavanky pavanky added the bug label Mar 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants