Skip to content

Commit 48b63a6

Browse files
committed
Flatten example inputs
1 parent 1c533e5 commit 48b63a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/xnnpack/aot_compiler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@
142142

143143
# Import quantized ops. This requires portable_lib to be loaded first.
144144
from executorch.kernels import quantized # usort: skip # noqa: F401, F403
145+
from torch.utils._pytree import tree_flatten
145146

146147
m = _load_for_executorch_from_buffer(exec_prog.buffer)
147148
logging.info("Successfully loaded the model")
148-
res = m.run_method("forward", *example_inputs)
149+
flattened = tree_flatten(example_inputs)[0]
150+
res = m.run_method("forward", flattened)
149151
logging.info("Successfully ran the model")

0 commit comments

Comments
 (0)