Skip to content

Commit 6096fcf

Browse files
committed
Update on "[executorch][schema] Add 'EXTERNAL' to DataLocation in schema"
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]
2 parents cb44325 + 017379b commit 6096fcf

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

exir/schema.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,21 @@ class TensorShapeDynamism(IntEnum):
4343
DYNAMIC_UNBOUND = 2
4444

4545

46+
class DataLocation(IntEnum):
47+
INLINE = 0
48+
SEGMENT = 1
49+
EXTERNAL = 2
50+
51+
4652
@dataclass
4753
class ExtraTensorInfo:
4854
"""
4955
Check program.fbs for explanations of this enum.
5056
"""
5157

52-
mutable_data_segments_idx: Optional[int] = None
58+
mutable_data_segments_idx: Optional[int] = 0
5359
fully_qualified_name: Optional[str] = None
54-
55-
56-
class DataLocation(IntEnum):
57-
INLINE = 0
58-
SEGMENT = 1
59-
EXTERNAL = 2
60+
location: Optional[DataLocation] = None
6061

6162

6263
@dataclass

0 commit comments

Comments
 (0)