Skip to content

Commit

Permalink
[luci/export Introdue empty_buffer as member (#13876)
Browse files Browse the repository at this point in the history
This will revise SerializedModelData to have first empty_buffer as member.

ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark authored Sep 2, 2024
1 parent ebe15bf commit 7b703b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/luci/export/src/CircleTensorExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ void prepareModelData(FlatBufferBuilder &builder, SerializedModelData &md)
// - Note the 0th entry of this array must be an empty buffer (sentinel).
// - This is a convention so that tensors without a buffer can provide 0 as
// - their buffer.
auto buffer = encodeOpBuffer(builder);
md._buffers.push_back(buffer);
md._empty_buffer = encodeOpBuffer(builder);
md._buffers.push_back(md._empty_buffer);
}

void exportOpDefinedTensors(loco::Graph *g, FlatBufferBuilder &builder, SerializedModelData &md,
Expand Down
1 change: 1 addition & 0 deletions compiler/luci/export/src/SerializedData.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ struct SerializedModelData final

std::unordered_map<OpCode, uint32_t> _operator_codes;
std::vector<flatbuffers::Offset<circle::Buffer>> _buffers;
flatbuffers::Offset<circle::Buffer> _empty_buffer;
CircleExportMetadata _metadata;

// This is used for removing buffers with same values
Expand Down

0 comments on commit 7b703b6

Please sign in to comment.