-
Notifications
You must be signed in to change notification settings - Fork 167
Open
Labels
triagelabel for issues that need to be triaged.label for issues that need to be triaged.
Description
Is your feature request related to a problem? Please describe.
When a vanilla node is created the default values of its parameters, if any, are available via node.default_parameter_values attribute. However, when a node is created by @parameterize, the values passed to the decorator are not available via the attribute. In fact they are not available from the node object at all.
The point I am making is that those values are essentially default values for the expanded node and should be surfaced in the same fashion. This feature would make expanded nodes equivalent to vanilla nodes in this regards.
Describe the solution you'd like
Define a node
x_value = {}
@parameterize(output_node=dict(x=value(x_value))
def fun(x):
return x
The following should hold
node = driver.graph.nodes['output_node']
# the passed in x_value and the stored value are the same objects
assert 'x' in node.default_parameter_values
assert node.default_parameter_values['x'] is x_value
# the passed in x_value and the object returned by the node are the same objects
result = driver.execute(final_vars=['output_node'])
assert result['output_node'] is x_value
Metadata
Metadata
Assignees
Labels
triagelabel for issues that need to be triaged.label for issues that need to be triaged.