Skip to content

Commit 8b90f0c

Browse files
committed
Update on "[executorch][flat_tensor] DataMap implementation"
DataMap implementation that * Loads a flat_tensor file * Populates a map with {fqn: tensor} and {fqn: TensorLayout}. * Makes tensor information available via the named_data_map.h interface. For now, DataMap doesn't store the DataLoader. - If/when tensors are in their own segments, DataMap should also store a DataLoader. Differential Revision: [D67064580](https://our.internmc.facebook.com/intern/diff/D67064580/) [ghstack-poisoned]
2 parents 7a8f1a6 + f209113 commit 8b90f0c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

extension/flat_tensor/flat_tensor_data_map.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ ET_NODISCARD Result<FreeableBuffer> FlatTensorDataMap::get_data(
108108

109109
// This FreeableBuffer doesn't own the underlying data, and will not free it,
110110
// which is why the free function is a nullptr.
111-
// TODO(T214294528)
111+
// TODO(T214294528): Remove data_ro_ and instead load the data here, letting
112+
// FreeableBuffer own it.
112113
return FreeableBuffer(
113114
static_cast<const uint8_t*>(data_ro_.data()) + metadata->offset(),
114115
tensor_layout_res.get().nbytes(),

extension/flat_tensor/flat_tensor_data_map.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class FlatTensorDataMap final : public executorch::runtime::NamedDataMap {
5757

5858
FlatTensorDataMap(FlatTensorDataMap&&) noexcept = default;
5959

60+
~FlatTensorDataMap() = default;
61+
6062
private:
6163
FlatTensorDataMap(
6264
executorch::runtime::FreeableBuffer&& flat_tensor_data,

0 commit comments

Comments
 (0)