We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 411ad4b commit 9beac22Copy full SHA for 9beac22
py/torch_tensorrt/dynamo/lowering/passes/lower_scaled_dot_product_attention.py
@@ -58,9 +58,10 @@ def lower_scaled_dot_product_attention(
58
# Copy the metadata of the replaced attention node to the new node
59
# TODO: Investigate why there are multiple FakeTensors in the metadata.
60
# We only use the first one as it contains the output shape information for this node.
61
- new_attention_node.meta["val"] = copy.copy(
62
- attention_node_replaced.meta["val"][0]
63
- )
+ if "val" in attention_node_replaced.meta:
+ new_attention_node.meta["val"] = copy.copy(
+ attention_node_replaced.meta["val"][0]
64
+ )
65
66
# If the attention operator had keyword-args, copy them to the new node
67
if attention_node_replaced.kwargs:
0 commit comments