Skip to content

Commit 683bb12

Browse files
zhxchen17pytorchmergebot
authored andcommitted
[export][ez] Update tag_ for union setters. (pytorch#146912)
Summary: ez fix to set tag for union type fields. Test Plan: CI Differential Revision: D69467715 Pull Request resolved: pytorch#146912 Approved by: https://github.com/yiming0416
1 parent 06f8f9a commit 683bb12

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

torch/_export/serde/schema_check.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ def accessor(name, ty, idx):
268268
269269
void set_{name}({ty} def) {{
270270
variant_.emplace<{idx + 1}>(std::move(def));
271+
tag_ = Tag::{name.upper()};
271272
}}
272273
"""
273274

0 commit comments

Comments
 (0)