@@ -76,7 +76,7 @@ def partition(
7676
7777 mlp = MLP ()
7878 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 ()
8080 aten = export (model , example_inputs , strict = True )
8181 spec_key = "path"
8282 spec_value = "/a/b/c/d"
@@ -137,7 +137,7 @@ def partition(
137137
138138 mlp = MLP ()
139139 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 ()
141141 aten = export (model , example_inputs , strict = True )
142142 edge = exir .to_edge (aten )
143143
@@ -177,7 +177,7 @@ def partition(
177177
178178 mlp = MLP ()
179179 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 ()
181181 edge = exir .to_edge (export (model , example_inputs , strict = True ))
182182
183183 with self .assertRaisesRegex (
@@ -229,7 +229,9 @@ def partition(
229229 partition_tags = partition_tags ,
230230 )
231231
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 ()
233235 edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
234236 delegated = edge .to_backend (PartitionerNoTagData ())
235237
@@ -308,7 +310,9 @@ def partition(
308310 partition_tags = partition_tags ,
309311 )
310312
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 ()
312316 edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
313317 delegated = edge .to_backend (PartitionerTagData ())
314318
@@ -383,7 +387,9 @@ def partition(
383387 partition_tags = partition_tags ,
384388 )
385389
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 ()
387393 edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
388394 delegated = edge .to_backend (PartitionerTagData ())
389395
@@ -471,7 +477,9 @@ def partition(
471477 )
472478
473479 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 ()
475483 edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
476484 exec_prog = edge .to_backend (PartitionerTagData ()).to_executorch ()
477485 executorch_module = _load_for_executorch_from_buffer (exec_prog .buffer )
@@ -531,7 +539,9 @@ def partition(
531539 partition_tags = partition_tags ,
532540 )
533541
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 ()
535545 edge = exir .to_edge (export (model , (torch .ones (2 , 2 ),), strict = True ))
536546 with self .assertRaises (RuntimeError ) as error :
537547 _ = edge .to_backend (PartitionerTagData ())
0 commit comments