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
PyTensor raises if you try to register the same rewrite twice. This is annoying when developing rewrites in an interactive environment, forcing constant restart of the interpreter. Would be nice to add an overwrite_existing flag to allow replacing the pre-existing rewrite by the new one. The logic of how rewrites are registered is pretty messy though, so it may require some work.
frompytensor.graph.rewriting.basicimportnode_rewriterfrompytensor.tensor.rewriting.basicimportregister_canonicalize@node_rewriter(None)defmy_rewrite():
passregister_canonicalize(my_rewrite)
register_canonicalize(my_rewrite) # ValueError: The tag 'my_rewrite' is already present in the database.
The text was updated successfully, but these errors were encountered:
Description
PyTensor raises if you try to register the same rewrite twice. This is annoying when developing rewrites in an interactive environment, forcing constant restart of the interpreter. Would be nice to add an
overwrite_existing
flag to allow replacing the pre-existing rewrite by the new one. The logic of how rewrites are registered is pretty messy though, so it may require some work.The text was updated successfully, but these errors were encountered: