Closed CarloLucibello closed 2 weeks ago
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"
# changes
if getn(ds) >= 0
numobs(x) == getn(ds) || throw(DimensionMismatch("expected $(getn(ds)) object features but got $(numobs(x))."))
end
return getdata(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)?