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
Shoul we also allow the following (currently erroring)?
julia> g.x =rand(1, 3)
ERROR: type GNNGraph has no field x
Stacktrace:
[1] setproperty!(x::GNNGraph{Tuple{Vector{Int64}, Vector{Int64}, Nothing}}, f::Symbol, v::Matrix{Float64})
@ Base ./Base.jl:38
[2] top-level scope
@ REPL[9]:1
The text was updated successfully, but these errors were encountered:
Would this include editing the Base.setproperty! function in datastore.jl to handle this specific case?
function Base.setproperty!(ds::DataStore, s::Symbol, x)
@assert s !=:_n"cannot set _n directly"@assert s !=:_data"cannot set _data directly"# changesifgetn(ds) >=0numobs(x) ==getn(ds) ||throw(DimensionMismatch("expected $(getn(ds)) object features but got $(numobs(x))."))
endreturngetdata(ds)[s] = x
end
This would involve implementing setproperty!(g::GNNGraph, ...). I think it is better to not proceed with this though, g.ndata.x = ... is much more transparent and convenient enough.
Right now we can conveniently add new features with
Shoul we also allow the following (currently erroring)?
The text was updated successfully, but these errors were encountered: