-
Notifications
You must be signed in to change notification settings - Fork 57
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
Reduction bug (?) with sparse tensors #184
Comments
Interestingly it appears to work if the |
this is not a bug, this is a missing feature ... the binary reduction op is run over a logical-and of the shapes to the two arguments. Indeed, note that in |
@evaleev is correct. I didn't encounter any cases where it wasn't necessary to have a logical-or reduction, or could not be accomplished by other means. In this case, you can: double v = (lhs("i") - rhs("i")).sum(); The feature could be added with a small amount of work in the binary reduction expression function. I can point out the bit of code, if anyone wants to take a stab at it. |
@justusc the subtraction was an example. What I'm literally trying to do is to implement Numpy's |
@justusc thanks, I think |
@evaleev yes, that is what I was going to point out. On a side note, c++17 would have made a lot of TA code much simpler. |
Not sure if this is a feature or a bug, but as far as I can tell the reduction functor is not used to reduce the tiles to scalars if one of the tiles is zero. For reductions without the zero-product property, this produces an incorrect result. MWE below.
I would expect the following to print 1, but it prints 0:
If you change
temp(0) = 0.0;
totemp(0) = 2.0
the code correctly prints -1.The text was updated successfully, but these errors were encountered: