Compare commits

...

1 Commits

Author SHA1 Message Date
6bcacd491e Annotation should be deepcopied 2025-11-04 14:04:30 -08:00

View File

@ -3,6 +3,7 @@
Contains various utils for AOTAutograd, including those for handling collections.
"""
import copy
import dataclasses
import logging
import operator
@ -459,7 +460,9 @@ def _copy_metadata_to_bw_nodes_in_subgraph(
node.meta["fwd_nn_module_stack"] = fwd_node.meta.get("nn_module_stack")
node.meta["fwd_source_fn_stack"] = fwd_node.meta.get("source_fn_stack")
# TODO: better to change to a specific field of custom?
node.meta["custom"] = fwd_node.meta.get("custom")
custom = fwd_node.meta.get("custom")
if custom is not None:
node.meta["custom"] = copy.deepcopy(custom)
def copy_fwd_metadata_to_bw_nodes(fx_g: torch.fx.GraphModule) -> None: