Skip to content

Commit

Permalink
Update on "[executorch][schema] Add 'EXTERNAL' to DataLocation in sch…
Browse files Browse the repository at this point in the history
…ema"

To indicate if a tensor is external to the PTE file or not.

Currently, we can also use the existence of 'fqn' to determine if a tensor is external or not.
I think it's better to have a specific location field as fqn may be required for cases besides external tensor storage.

Differential Revision: [D66523171](https://our.internmc.facebook.com/intern/diff/D66523171/)

[ghstack-poisoned]
  • Loading branch information
lucylq committed Dec 6, 2024
2 parents cb44325 + 017379b commit 6096fcf
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions exir/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,21 @@ class TensorShapeDynamism(IntEnum):
DYNAMIC_UNBOUND = 2


class DataLocation(IntEnum):
INLINE = 0
SEGMENT = 1
EXTERNAL = 2


@dataclass
class ExtraTensorInfo:
"""
Check program.fbs for explanations of this enum.
"""

mutable_data_segments_idx: Optional[int] = None
mutable_data_segments_idx: Optional[int] = 0
fully_qualified_name: Optional[str] = None


class DataLocation(IntEnum):
INLINE = 0
SEGMENT = 1
EXTERNAL = 2
location: Optional[DataLocation] = None


@dataclass
Expand Down

0 comments on commit 6096fcf

Please sign in to comment.