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
Some trivial information queries become time-consuming because currently there's no way to pass this extra information. And it just falls back to apply the function again and again and again and becomes very inefficient.
using TestImages, ImageTransformations
img =testimage("cameraman")
As =mappedarray(θ->imrotate(img, θ, axes(img)), -π/4:π/16:π/4);
@btimesize.($As); # 22.033 ms (136 allocations: 2.26 MiB)@btimecollect($As); # 22.880 ms (127 allocations: 2.26 MiB)
For this very specific case, axes can be known prior.
The text was updated successfully, but these errors were encountered:
julia> f = θ->imrotate(img, θ, axes(img))
#11 (generic function with 1 method)
julia>typeof(f(π/4))
Matrix{ColorTypes.Gray{FixedPointNumbers.N0f8}} (alias for Array{ColorTypes.Gray{FixedPointNumbers.Normed{UInt8, 8}}, 2})
julia> Base.return_types(f, (typeof(π/4),))
1-element Vector{Any}:
Any
Even if imrotate was written such that the type was inferred correctly, the type itself does not contain information about axes (unlike e.g. StaticArrays.StaticArray, or Tuple.).
Said differently, it does not seem like a MappedArrays.jl issue. I don't know how to get the following answer without evaluating f:
Some trivial information queries become time-consuming because currently there's no way to pass this extra information. And it just falls back to apply the function again and again and again and becomes very inefficient.
For this very specific case,
axes
can be known prior.The text was updated successfully, but these errors were encountered: