Skip to content

Commit b05d02c

Browse files
committed
Update on "[executorch][flat_tensor] flat tensor header"
Parse a FlatTensor header. The FlatTensor header contains: - flatbuffer offset - flatbuffer size - segment base offset - segment data size (total size of all segments) Mostly taken from extended_header.cpp/.h Differential Revision: [D67064570](https://our.internmc.facebook.com/intern/diff/D67064570/) [ghstack-poisoned]
2 parents e3d9f0e + b776c98 commit b05d02c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

extension/flat_tensor/serialize/flat_tensor_header.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct FlatTensorHeader {
2121
* To find the header, callers should provide at least this many bytes of the
2222
* head of the serialized FlatTensor data.
2323
*/
24-
static constexpr size_t kNumHeadBytes = 48;
24+
static constexpr size_t kNumHeadBytes = 64;
2525

2626
/**
2727
* The magic bytes that identify the header. This should be in sync with

extension/flat_tensor/test/flat_tensor_header_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ constexpr char kExampleHeaderData[] = {
3939
// Magic bytes
4040
'F', 'H', '0', '1',
4141
// uint32_t header size (little endian)
42-
0x40, 0x00, 0x00, 0x00,
42+
0x28, 0x00, 0x00, 0x00,
4343
// uint64_t flatbuffer_offset
4444
0x71, 0x61, 0x51, 0x41, 0x31, 0x21, 0x11, 0x01,
4545
// uint64_t flatbuffer_size

0 commit comments

Comments
 (0)