Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Param(x) as AbstractArray? #125

Open
JeffFessler opened this issue Jul 14, 2021 · 1 comment
Open

Param(x) as AbstractArray? #125

JeffFessler opened this issue Jul 14, 2021 · 1 comment

Comments

@JeffFessler
Copy link

JeffFessler commented Jul 14, 2021

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.

@denizyuret
Copy link
Owner

denizyuret commented Jul 14, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants