Skip to content

Commit 44d8d54

Browse files
authored
Add unwrap_tensor_subclass to xnnpack
1 parent dfa2d7a commit 44d8d54

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

optimum/exporters/executorch/recipes/xnnpack.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from tabulate import tabulate
1919
from torch.export import ExportedProgram
20+
from torchao.utils import unwrap_tensor_subclass
2021

2122
from executorch.backends.xnnpack.partition.xnnpack_partitioner import XnnpackPartitioner
2223
from executorch.devtools.backend_debug import get_delegation_info
@@ -104,6 +105,7 @@ def _lower_to_executorch(
104105
)
105106
return {pte_name: et_prog}
106107

108+
model = unwrap_tensor_subclass(model)
107109
exported_progs = model.export()
108110

109111
if (

0 commit comments

Comments
 (0)