Skip to content

Commit 073e7d8

Browse files
pytorchbotlucylq
andauthored
Update usages of DataLoader::SegmentInfo::Type::External (pytorch#15281)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: pytorch#15195 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/120/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/lucylq/120/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/lucylq/120/orig Differential Revision: [D83671426](https://our.internmc.facebook.com/intern/diff/D83671426/) @diff-train-skip-merge Co-authored-by: lucylq <[email protected]>
1 parent cf407fc commit 073e7d8

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

extension/flat_tensor/flat_tensor_data_map.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ ET_NODISCARD Result<FreeableBuffer> FlatTensorDataMap::get_data(
135135
return loader_->load(
136136
/*offset=*/header_.segment_base_offset + segment_offset,
137137
segment_size,
138-
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::External));
138+
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::Constant));
139139
}
140140

141141
ET_NODISCARD Error FlatTensorDataMap::load_data_into(
@@ -201,7 +201,7 @@ ET_NODISCARD Result<const char*> FlatTensorDataMap::get_key(
201201
Result<FreeableBuffer> header = loader->load(
202202
/*offset=*/0,
203203
FlatTensorHeader::kNumHeadBytes,
204-
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::External));
204+
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::Program));
205205
if (!header.ok()) {
206206
ET_LOG(Error, "Failed to load header.");
207207
return header.error();
@@ -228,7 +228,7 @@ ET_NODISCARD Result<const char*> FlatTensorDataMap::get_key(
228228
Result<FreeableBuffer> flat_tensor_data = loader->load(
229229
/*offset=*/0,
230230
fh->flatbuffer_offset + fh->flatbuffer_size,
231-
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::External));
231+
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::Program));
232232
if (!flat_tensor_data.ok()) {
233233
ET_LOG(Error, "Failed to load flat_tensor data.");
234234
return flat_tensor_data.error();

extension/flat_tensor/test/flat_tensor_data_map_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ TEST_F(FlatTensorDataMapTest, LoadAndCheckSize) {
173173
Result<FreeableBuffer> truncated_file = data_map_loader_->load(
174174
0,
175175
trunc_size,
176-
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::External));
176+
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::Constant));
177177
ASSERT_EQ(truncated_file.error(), Error::Ok);
178178

179179
BufferDataLoader truncated_loader =

extension/training/module/test/state_dict_util_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class LoadStateDictTest : public ::testing::Test {
4444
/*offset=*/0,
4545
FlatTensorHeader::kNumHeadBytes,
4646
/*segment_info=*/
47-
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::External));
47+
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::Program));
4848

4949
ASSERT_EQ(header.error(), Error::Ok);
5050

runtime/executor/pte_data_map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Result<FreeableBuffer> PteDataMap::get_data(
5757
return loader_->load(
5858
/*offset=*/segment_base_offset_ + segment_offset,
5959
segment_size,
60-
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::External));
60+
DataLoader::SegmentInfo(DataLoader::SegmentInfo::Type::Constant));
6161
}
6262
}
6363
return Error::NotFound;

0 commit comments

Comments
 (0)