Short name describing what triggered the graph break
Invalid use of pytree_flatten with nonstrict_trace-ed function
Values or code snippet captured at the break point
Input={input_spec_vt}, offending type <{type_name}>.
Explanation of why the graph break was triggered
Calling a nonstrict_trace
-ed function where one of the inputs has been registered with a pytree_flatten
that places an object of type <{type_name}> into the context.
Hints on how to resolve the graph break
pytree_flatten
to avoid placing the object into the context.Apply one of the following to <{type_name}>:
torch.utils._pytree.register_constant
torch.utils._pytree.register_dataclass
torch.utils._pytree.register_pytree_node