You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that vfilter, vmap, etc can't handle multiple conditions?
x = rand(10)
cond(a) = ((a > 0.25) && (a < 0.75))
vfilter(cond,x) # ERROR: TypeError: non-boolean (VectorizationBase.Mask{4, UInt8}) used in boolean context
filter(cond,x) # this works
vmap(cond,x) # ERROR: TypeError: non-boolean (VectorizationBase.Mask{4, UInt8}) used in boolean context
map(cond,x) # this works
Thanks
The text was updated successfully, but these errors were encountered:
Let me know if you have any further issues.
Unfortunately, supporting && and || is not possible without compiler magic.
LoopModels, the eventual successor to LoopVectorization.jl, will support those.
But LoopVectorization.jl is implemented largely using multiple dispatch, and it is not possible to overload && and || as these are syntax, not functions.
As a word of caution, note that & and | don't have the same precedence as && and ||, so you'll have to be sure and add parenthesis whenever using them, like you did in your example.
It seems that
vfilter
,vmap
, etc can't handle multiple conditions?Thanks
The text was updated successfully, but these errors were encountered: