File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
src/plugins/intel_npu/src/plugin/src Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -126,12 +126,10 @@ void Metadata<METADATA_VERSION_2_1>::read(const ov::Tensor& tensor) {
126126void Metadata<METADATA_VERSION_2_2>::read(std::istream& stream) {
127127 Metadata<METADATA_VERSION_2_1>::read (stream);
128128
129- int64_t batchSize;
129+ std::optional< int64_t > batchSize;
130130 stream.read (reinterpret_cast <char *>(&batchSize), sizeof (batchSize));
131131
132- if (batchSize) {
133- _batchSize = std::optional (batchSize);
134- }
132+ _batchSize = batchSize;
135133}
136134
137135void Metadata<METADATA_VERSION_2_2>::read(const ov::Tensor& tensor) {
@@ -186,9 +184,8 @@ void Metadata<METADATA_VERSION_2_1>::write(std::ostream& stream) {
186184void Metadata<METADATA_VERSION_2_2>::write(std::ostream& stream) {
187185 Metadata<METADATA_VERSION_2_1>::write (stream);
188186
189- if (_batchSize.has_value ()) {
190- stream.write (reinterpret_cast <const char *>(&_batchSize), sizeof (_batchSize));
191- }
187+ // _batchSize is std::optional, so either the value or std::nullopt will be written
188+ stream.write (reinterpret_cast <const char *>(&_batchSize), sizeof (_batchSize));
192189
193190 append_padding_blob_size_and_magic (stream);
194191}
You can’t perform that action at this time.
0 commit comments