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

torch.all only returns true if all numbers in the tensor are odd #517

Closed
dominikgrewe opened this issue Jan 27, 2016 · 1 comment
Closed

Comments

@dominikgrewe
Copy link
Member

It uses a bit-wise reduction with &= and initialization 1, i.e. it only looks at the lowest bit of all numbers. It should use a logical and instead.

For example return torch.ByteTensor(3):fill(2):all() returns false.

ivpopov added a commit to ivpopov/torch7 that referenced this issue Feb 4, 2016
torch.all only returns true if all numbers in the tensor are odd torch#517
ivpopov added a commit to ivpopov/torch7 that referenced this issue Feb 8, 2016
torch.all only returns true if all numbers in the tensor are odd torch#517

Update THTensorMath.c

Respective test
soumith added a commit that referenced this issue Feb 8, 2016
@andreaskoepf
Copy link
Contributor

@dominikgrewe Seems to be fixed, can we close it?

colesbury pushed a commit to colesbury/torch7 that referenced this issue Nov 3, 2016
torch.all only returns true if all numbers in the tensor are odd torch#517

Update THTensorMath.c

Respective test
colesbury pushed a commit to colesbury/torch7 that referenced this issue Nov 3, 2016
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

No branches or pull requests

2 participants