Skip to content

for better inferred effects, avoid relying on reshape(::Array, ::Vararg)? #35

@nsajko

Description

@nsajko

Either that or fix the effects upstream. The effects infer horribly:

julia> Base.infer_effects(reshape, Tuple{Vector{Float32}, Tuple{Int}})
(!c,!e,!n,!t,!s,!m,!u,+o,!r)

julia> Base.infer_effects(reshape, Tuple{Vector{Float32}, Tuple{Int, Colon}})
(!c,!e,!n,!t,!s,!m,!u,!o,!r)

julia> Base.infer_effects(reshape, Tuple{Vector{Float32}, Tuple{Colon, Int}})
(!c,!e,!n,!t,!s,!m,!u,!o,!r)

Even constprop doesn't seem to be able to help:

julia> Base.infer_effects((x -> reshape(x, (3,))), Tuple{Vector{Float32}})
(!c,!e,!n,!t,!s,!m,!u,+o,!r)

julia> Base.infer_effects((x -> reshape(x, (3, :))), Tuple{Vector{Float32}})
(!c,!e,!n,!t,!s,!m,!u,!o,!r)

julia> Base.infer_effects((x -> reshape(x, (:, 3))), Tuple{Vector{Float32}})
(!c,!e,!n,!t,!s,!m,!u,!o,!r)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions