Skip to content

Commit 6be02ce

Browse files
zhxchen17facebook-github-bot
authored andcommitted
Serialize union fields with single entry dict. (#2279)
Summary: X-link: pytorch/pytorch#121337 Pull Request resolved: #2279 remove "$type" and "$value" fields, instead only serialize as {type: value} for union fields directly. bypass-github-export-checks Reviewed By: tugsbayasgalan Differential Revision: D54600943 fbshipit-source-id: d4bab91541db42eec2d8ead1176db6acf0db8ef3
1 parent 47b837b commit 6be02ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exir/serde/export_serialize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def serialize_tensor_meta(t: torch.Tensor) -> TensorMeta:
220220
requires_grad=t.requires_grad,
221221
device=Device(type=t.device.type, index=t.device.index),
222222
strides=[serialize_sym_int(s) for s in t.stride()],
223-
storage_offset=0,
223+
storage_offset=serialize_sym_int(0),
224224
layout=_TORCH_TO_SERIALIZE_LAYOUT[t.layout],
225225
)
226226

0 commit comments

Comments
 (0)