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(