Skip to content

Commit b9c6488

Browse files
hsharma35facebook-github-bot
authored andcommitted
Enable constant methods in cadence export. (pytorch#7948)
Summary: Add option to specify constant methods in export. The constants show up as methods (similar to "forward") in the serialized .pte. Reviewed By: zonglinpeng Differential Revision: D68637824
1 parent e52b3fc commit b9c6488

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backends/cadence/aot/compiler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def export_to_edge(
174174
model: torch.nn.Module,
175175
inputs: tuple[object, ...],
176176
dump_graphs: bool = False,
177+
constant_methods: Optional[dict[str, object]] = None,
177178
) -> EdgeProgramManager:
178179
assert isinstance(model, torch.nn.Module), "model should be an nn.Module"
179180

@@ -195,6 +196,7 @@ def export_to_edge(
195196
torch.ops.aten.angle.default,
196197
],
197198
),
199+
constant_methods=constant_methods,
198200
)
199201

200202
if dump_graphs:

0 commit comments

Comments
 (0)