deprecate implicit shared-variable capture in OpFromGraph#2047
Conversation
| "All variables needed to compute inner-graph must be provided as inputs under strict=True. " | ||
| f"The inner-graph implicitly depends on the following shared variables {self.shared_inputs}" | ||
| ) | ||
| elif self.shared_inputs: |
There was a problem hiding this comment.
strict=True forbids implicit shared variables.
We are in practice deprecating implicit shared variables then. That's good but the warning message is confusing by mentioning strict
There was a problem hiding this comment.
Agreed. I'll simplify the message to state that the behavior is deprecated and provide the direct fix.
Tell me if this could be enough:
warnings.warn( "Implicit capture of shared variables is deprecated. " "Please provide shared variables explicitly in the 'inputs' list.", FutureWarning, stacklevel=2, )
|
idk what happened... is it my fault? |
…-variables-in-OpFromGraph
|
Of course was my fault :) now is ready! |
|
I don't even know what happened but if blame is settled as must be good |
| warnings.warn( | ||
| "Implicit capture of shared variables is deprecated. " | ||
| "Please provide shared variables explicitly in the 'inputs' list.", | ||
| FutureWarning, |
There was a problem hiding this comment.
Let's make it DeprecationWarning. Users aren't really building OFGs and it gives a bit of room for devs in downstream packages to tackle it
Removed parameterization for test_pullback_disconnected_output_grad.
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Description
This PR starts deprecating implicit shared-variable capture in OpFromGraph when strict=False.
Related Issue
Checklist
Type of change