@@ -76,7 +76,7 @@ def partition(
76
76
77
77
mlp = MLP ()
78
78
example_inputs = mlp .get_random_inputs ()
79
- model = export_for_training (mlp , example_inputs ).module ()
79
+ model = export_for_training (mlp , example_inputs , strict = True ).module ()
80
80
aten = export (model , example_inputs , strict = True )
81
81
spec_key = "path"
82
82
spec_value = "/a/b/c/d"
@@ -137,7 +137,7 @@ def partition(
137
137
138
138
mlp = MLP ()
139
139
example_inputs = mlp .get_random_inputs ()
140
- model = export_for_training (mlp , example_inputs ).module ()
140
+ model = export_for_training (mlp , example_inputs , strict = True ).module ()
141
141
aten = export (model , example_inputs , strict = True )
142
142
edge = exir .to_edge (aten )
143
143
@@ -177,7 +177,7 @@ def partition(
177
177
178
178
mlp = MLP ()
179
179
example_inputs = mlp .get_random_inputs ()
180
- model = export_for_training (mlp , example_inputs ).module ()
180
+ model = export_for_training (mlp , example_inputs , strict = True ).module ()
181
181
edge = exir .to_edge (export (model , example_inputs , strict = True ))
182
182
183
183
with self .assertRaisesRegex (
@@ -229,7 +229,9 @@ def partition(
229
229
partition_tags = partition_tags ,
230
230
)
231
231
232
- model = export_for_training (self .AddConst (), (torch .ones (2 , 2 ),)).module ()
232
+ model = export_for_training (
233
+ self .AddConst (), (torch .ones (2 , 2 ),), strict = True
234
+ ).module ()
233
235
edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
234
236
delegated = edge .to_backend (PartitionerNoTagData ())
235
237
@@ -308,7 +310,9 @@ def partition(
308
310
partition_tags = partition_tags ,
309
311
)
310
312
311
- model = export_for_training (self .AddConst (), (torch .ones (2 , 2 ),)).module ()
313
+ model = export_for_training (
314
+ self .AddConst (), (torch .ones (2 , 2 ),), strict = True
315
+ ).module ()
312
316
edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
313
317
delegated = edge .to_backend (PartitionerTagData ())
314
318
@@ -383,7 +387,9 @@ def partition(
383
387
partition_tags = partition_tags ,
384
388
)
385
389
386
- model = export_for_training (self .AddConst (), (torch .ones (2 , 2 ),)).module ()
390
+ model = export_for_training (
391
+ self .AddConst (), (torch .ones (2 , 2 ),), strict = True
392
+ ).module ()
387
393
edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
388
394
delegated = edge .to_backend (PartitionerTagData ())
389
395
@@ -471,7 +477,9 @@ def partition(
471
477
)
472
478
473
479
inputs = (torch .ones (2 , 2 ),)
474
- model = export_for_training (ReuseConstData (), (torch .ones (2 , 2 ),)).module ()
480
+ model = export_for_training (
481
+ ReuseConstData (), (torch .ones (2 , 2 ),), strict = True
482
+ ).module ()
475
483
edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
476
484
exec_prog = edge .to_backend (PartitionerTagData ()).to_executorch ()
477
485
executorch_module = _load_for_executorch_from_buffer (exec_prog .buffer )
@@ -531,7 +539,9 @@ def partition(
531
539
partition_tags = partition_tags ,
532
540
)
533
541
534
- model = export_for_training (ReuseConstData (), (torch .ones (2 , 2 ),)).module ()
542
+ model = export_for_training (
543
+ ReuseConstData (), (torch .ones (2 , 2 ),), strict = True
544
+ ).module ()
535
545
edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
536
546
with self .assertRaises (RuntimeError ) as error :
537
547
_ = edge .to_backend (PartitionerTagData ())
0 commit comments