4
4
# This source code is licensed under the BSD-style license found in the
5
5
# LICENSE file in the root directory of this source tree.
6
6
7
- import copy
8
-
9
7
import logging
10
8
from dataclasses import dataclass
11
9
from typing import Dict , final , List
@@ -86,7 +84,6 @@ def preprocess(
86
84
edge_program : ExportedProgram ,
87
85
compile_specs : List [CompileSpec ],
88
86
) -> PreprocessResult :
89
- ep = copy .deepcopy (edge_program )
90
87
# Need to wrap EP here because xnnpack does addmm to linear
91
88
# transforms. This makes resulting graph not aten compliant
92
89
# as aten.linear is not a core aten op.
@@ -97,17 +94,17 @@ def preprocess(
97
94
# EdgeDialectVerifier, but disable it.
98
95
# TODO (task link) to implement NullVerifier or something similar
99
96
ep = ExportedProgram (
100
- root = ep .graph_module ,
101
- graph = ep .graph ,
102
- graph_signature = ep .graph_signature ,
103
- state_dict = ep .state_dict ,
104
- range_constraints = ep .range_constraints ,
105
- module_call_graph = copy . deepcopy ( ep . module_call_graph ) ,
106
- example_inputs = ep .example_inputs ,
97
+ root = edge_program .graph_module ,
98
+ graph = edge_program .graph ,
99
+ graph_signature = edge_program .graph_signature ,
100
+ state_dict = edge_program .state_dict ,
101
+ range_constraints = edge_program .range_constraints ,
102
+ module_call_graph = edge_program . module_call_graph ,
103
+ example_inputs = edge_program .example_inputs ,
107
104
verifier = EXIREdgeDialectVerifier (
108
105
check_edge_ops = False , enable = False , class_only = True
109
106
),
110
- constants = ep .constants ,
107
+ constants = edge_program .constants ,
111
108
)
112
109
113
110
passes = []
0 commit comments