-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
inconsistent behavior of .copy() on immutable graphs #35592
Comments
Actually, an immutable "copy" of an immutable graph could actually just be a reference to the original. It's immutable after all! The only reason to make a copy of an immutable object is to get a mutable copy. I'm pretty sure this is the rationale behind the behaviour. It is consistent with, for instance, vectors:
|
I'm fine with whatever outcome of |
Btw, #34598 is another issue when using |
A workaround may be to use It looks like the If you change the applied function to
you can see that the reproduction through multiprocessing has a different backend defined. Looking at
|
Thank you for the insight. As I view it now, the current issue is in fact a combination of two rather unrelated ones:
Personally I care more about the first issue as I see some other buggy things happening around it, while |
Is there an existing issue for this?
Did you read the documentation and troubleshoot guide?
Environment
Steps To Reproduce
Function
f(H)
below print the immutability status of a given graphH
and that ofH.copy()
:Expected Behavior
Whether we use multiprocessing or not,
H.copy()
should inherit the immutability ofH
.Actual Behavior
The code output is:
First, we create an immutable graph
G
. When we callf(G)
directly, the created copy of it is immutable (as expected). However, when we call the same function using via multiprocessing,f
reports the the input graph is still immutable (which is good), while its copy somehow becomes not immutable (which is bad).Additional Information
No response
The text was updated successfully, but these errors were encountered: