File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 22
22
)
23
23
from executorch .exir ._serialize ._serialize import serialize_for_executorch
24
24
from executorch .exir ._serialize .data_serializer import DataSerializer
25
+ from executorch .exir ._warnings import experimental
25
26
from executorch .exir .backend .backend_api import (
26
27
MethodProgramsPartitionerSpec ,
27
28
to_backend ,
@@ -626,6 +627,24 @@ def buffer(self) -> bytes:
626
627
self ._buffer = bytes (self ._get_pte_data ())
627
628
return self ._buffer
628
629
630
+ @property
631
+ @experimental ("This API is experimental and subject to change without notice." )
632
+ def data_files (self ) -> Dict [str , bytes ]:
633
+ """Returns the data files as a dictionary of filename to byte data.
634
+
635
+ Returns:
636
+ Dict[str, bytes]: Dictionary mapping data filenames (e.g., .ptd files) to
637
+ their serialized byte content.
638
+ Returns empty dict if no data files are available.
639
+ """
640
+ if self ._pte_data is None :
641
+ self ._get_pte_data () # This populates _tensor_data
642
+
643
+ if self ._tensor_data is None :
644
+ return {}
645
+
646
+ return {filename : bytes (cord ) for filename , cord in self ._tensor_data .items ()}
647
+
629
648
@property
630
649
def program (self ) -> Program :
631
650
return self ._get_emitter_output ().program
You can’t perform that action at this time.
0 commit comments