-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement __copy__
and __deepcopy__
model methods
#6985
Comments
__copy__
and __deepcopy__
model methods
Hey @ricardoV94 I'd like to try implementing this. I just need some guidance. I don't quite understand what a shallow copy of a PYMC Model would entail. From what I understand, you can't mutate nested structures in a PYMC Model after you define the model. I think what |
We don't need a shallow copy, both methods can do a deep copy pm.do itself also does a deepcopy before doing its business |
Oh okay, I see what you are saying. So both |
Yup |
Okay, cool. Thanks! |
Description
A couple of users on discourse got some nasty bugs when trying to do
copy.deepcopy(model)
. Whatever the default is doing, it ain't great.We have a
clone_model
inmodel/fgraph
that we can use for both copy and deepcopy!It should work in all cases except for the known issue with GP variables #6883
The text was updated successfully, but these errors were encountered: