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
but broadcasting literal_pow has Base.RefValue{typeof(^)}(^) and Base.RefValue{Val{2}}(Val{2}()) in its argument, which cause MethodError
MWE:
using LazyArrays
bc = @~ x .^2# use LazyArrays to get the Broadcasted objectsum(bc, dims=1) # MethodError for has_fast_linear_indexing(::Base.RefValue{typeof(^)})
versioninfo:
julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake-avx512)
Environment:
JULIA_NUM_THREADS = 8
The text was updated successfully, but these errors were encountered:
Sounds like it need a method for RefValue? i.e. just add
has_fast_linear_indexing(bc::Ref) =true
(Note that if I add the above method, or just change your test case to bc = @~ x .+ 2 to avoid literal_pow, then sum(bc, dims=1) gives me a different MethodError, this time for reducedim_init on a Broadcasted object. But that's an unrelated problem—sum(bc, dims=1, init=0.0) succeeds. I see you already filed that as #41054.)
stevengj
changed the title
Broadcast literal_pow break Base.has_fast_linear_indexingBase.has_fast_linear_indexing needs a method for RefJun 3, 2021
has_fast_linear_indexing
forBroadcasted
check all the arguments,julia/base/reducedim.jl
Lines 194 to 198 in 58ffe7e
but broadcasting
literal_pow
hasBase.RefValue{typeof(^)}(^)
andBase.RefValue{Val{2}}(Val{2}())
in its argument, which causeMethodError
MWE:
versioninfo:
The text was updated successfully, but these errors were encountered: