From f95d88f08d46f4503486b6997c1f8d480488114b Mon Sep 17 00:00:00 2001 From: Tarun Karuturi Date: Tue, 13 Feb 2024 12:28:24 -0800 Subject: [PATCH] Add missing persistent flat in deserialize_input_spec Summary: ^ Reviewed By: chakriu Differential Revision: D53713471 fbshipit-source-id: 3419dd6909f8735126c68d3844c847042adcec40 --- exir/serde/export_serialize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exir/serde/export_serialize.py b/exir/serde/export_serialize.py index ab24688379..121354bf74 100644 --- a/exir/serde/export_serialize.py +++ b/exir/serde/export_serialize.py @@ -738,6 +738,7 @@ def serialize_input_spec(self, spec: ep.InputSpec) -> InputSpec: elif spec.kind == ep.InputKind.BUFFER: assert spec.target is not None assert isinstance(spec.arg, ep.TensorArgument) + assert spec.persistent is not None return InputSpec.create( buffer=InputToBufferSpec( arg=TensorArgument(name=spec.arg.name), @@ -1319,6 +1320,7 @@ def deserialize_input_spec(self, i: InputSpec) -> ep.InputSpec: kind=ep.InputKind.BUFFER, arg=PyTensorArgument(name=i.buffer.arg.name), target=i.buffer.buffer_name, + persistent=i.buffer.persistent, ) elif i.type == "tensor_constant": return ep.InputSpec(