unreserve_name function does not respect already declared variables
See original GitHub issueI believe there is a bug in the Scope.unreserve_name
function: It removes the name from the Scope.onnx_variable_names
even if it is already declared in Scope.variables
.
If that happens then variables in Scope.variables
could get overwritten. That is because the unique variable name is not taken anymore but a name-variable pair is already set in Scope.variables
.
This happened to me and was quite difficult to debug.
My suggested solution is to only unreserve an ONNX name, if the name is not already used in Scope.variables
. If it is, then it should raise a warning instead of throwing an error. You could also make it throw an error, but then you’d have to fix it in parse_sklearn
(which is I believe the only time the unreserve_name
function is actually called):
Another approach would be to get rid of unreserve_name
altogether, since it’s only called once and doesn’t seem particularly useful. But maybe I’m mistaken here. 🙂
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
I think the current design is over complicated. PR #726 simplifies it. It removes reserved_names. I’ll see if it is not too complicated to ix all unit tests it will probably break. parser and shape_calculator could be removed.
Thanks, #726 is ready to be reviewed.