Skip to content

Commit b495fa3

Browse files
pytorchbotlucylq
andauthored
Relax verification on flat tensor (#15334)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #15313 by @lucylq ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/lucylq/121/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/lucylq/121/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/lucylq/121/orig Differential Revision: [D85169688](https://our.internmc.facebook.com/intern/diff/D85169688/) @diff-train-skip-merge Co-authored-by: lucylq <[email protected]>
1 parent 8ce3095 commit b495fa3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extension/flat_tensor/flat_tensor_data_map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ ET_NODISCARD Result<const char*> FlatTensorDataMap::get_key(
218218
size_t expected_size = fh->segment_base_offset + fh->segment_data_size;
219219
size_t actual_size = loader->size().get();
220220
ET_CHECK_OR_RETURN_ERROR(
221-
expected_size == actual_size,
221+
expected_size <= actual_size,
222222
InvalidExternalData,
223223
"File size is too small; file may be corrupted or truncated. Expected %zu from flat_tensor header, received %zu from data loader",
224224
expected_size,

0 commit comments

Comments
 (0)