symbolic-pymc
symbolic-pymc copied to clipboard
Partially specified NodeDef.attr
It might be worth investigating a way to partially specify the NodeDef.attr dict, especially since complete removal/reassignment causes problems for constants (the Numpy constant value is held in that map). In other words, it would be like saying "NodeDef.attr is a dict that at least contains a "data" key."
A nice way of doing this could make use of a partially specified cons map: i.e. an object like cons(('data', 1), ..., var()) that represents OrderedDict(('data': 1), ...). We would need a helper class to provide the standard dict interface and a means of stating that the cdr must ultimately be an OrderedDict; otherwise, cons will already work in this capacity.
Originally posted by @brandonwillard in https://github.com/pymc-devs/symbolic-pymc/issues/35#issuecomment-547125236