Open alvarobartt opened 1 year ago
Hi @AlexeyKurakin (sorry for mentioning you here in case you're not actively working on this), can you confirm whether the expected behavior of .update
is to also allow VarCollection
, because according to the typing of the .update
function it is, I can work on this issue as well as the referenced one if you want 😄 Thanks!
Hi everyone! Thanks for the awesome work with
objax
and the JAX environment, and happy holidays!I was playing around for
objax
for a bit, and realized that if you try to update themodel.vars()
which is aVarCollection
using theVarCollection.update
method overwriting the defaultdict.update
method, if what you pass to the function is a Python dictionary and not aVarCollection
it fails, as it's being cast into a Python list, and then we're trying to loop over the items of a list as if it was a Python dictionary, so it throws aValueError: too many values to unpack (expected 2)
.https://github.com/google/objax/blob/53b391bfa72dc59009c855d01b625049a35f5f1b/objax/variable.py#L311-L318
Is this intended? Shouldn't
VarCollection.update
just loop over classes that allow.items()
?