Skip to content

Param(x) as AbstractArray? #125

Description

@JeffFessler

Would it be possible to make Param(x) have a subtype of AbstractArray (when x is)?

julia> x = [1, 2]
2-element Vector{Int64}:
 1
 2

julia> xp = Param(x)
2-element Param{Vector{Int64}}:
 1
 2

julia> supertypes(typeof(xp))
(Param{Vector{Int64}}, AutoGrad.Tracked{Vector{Int64}}, AutoGrad.Value{Vector{Int64}}, Any)

julia> xp isa AbstractArray
false

So currently the Param version xp cannot be passed to any functions that are expecting AbstractArray inputs.

Edit: I guess it's really AutoGrad.Value{Vector{Int64}} that I am wondering if could be a subtype of AA.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions