|
14 | 14 |
|
15 | 15 | import torch |
16 | 16 | import torch.nn as nn |
17 | | -from torch.export import export_for_training |
18 | 17 | from torch.testing._internal.common_quantization import ( |
19 | 18 | NodeSpec as ns, |
20 | 19 | ) |
@@ -315,10 +314,7 @@ def _test_quantizer( |
315 | 314 |
|
316 | 315 | # program capture |
317 | 316 | m = copy.deepcopy(m_eager) |
318 | | - m = export_for_training( |
319 | | - m, |
320 | | - example_inputs, |
321 | | - ).module() |
| 317 | + m = torch.export.export(m, example_inputs).module() |
322 | 318 |
|
323 | 319 | # QAT Model failed to deepcopy |
324 | 320 | export_model = m if is_qat else copy.deepcopy(m) |
@@ -576,7 +572,7 @@ def _test_linear_unary_helper( |
576 | 572 | Test pattern of linear with unary post ops (e.g. relu) with ArmInductorQuantizer. |
577 | 573 | """ |
578 | 574 | use_bias_list = [True, False] |
579 | | - # TODO test for inplace add after refactoring of export_for_training |
| 575 | + # TODO test for inplace add after refactoring of export |
580 | 576 | inplace_list = [False] |
581 | 577 | if post_op_algo_list is None: |
582 | 578 | post_op_algo_list = [None] |
@@ -716,7 +712,7 @@ def _test_linear_binary_helper(self, is_qat=False, is_dynamic=False): |
716 | 712 | Currently, only add as binary post op is supported. |
717 | 713 | """ |
718 | 714 | linear_pos_list = [NodePosType.left, NodePosType.right, NodePosType.both] |
719 | | - # TODO test for inplace add after refactoring of export_for_training |
| 715 | + # TODO test for inplace add after refactoring of export |
720 | 716 | inplace_add_list = [False] |
721 | 717 | example_inputs = (torch.randn(2, 16),) |
722 | 718 | quantizer = ArmInductorQuantizer().set_global( |
@@ -1078,7 +1074,7 @@ def forward(self, x): |
1078 | 1074 | ) |
1079 | 1075 | example_inputs = (torch.randn(2, 2),) |
1080 | 1076 | m = M().eval() |
1081 | | - m = export_for_training(m, example_inputs).module() |
| 1077 | + m = torch.export.export(m, example_inputs).module() |
1082 | 1078 | m = prepare_pt2e(m, quantizer) |
1083 | 1079 | # Use a linear count instead of names because the names might change, but |
1084 | 1080 | # the order should be the same. |
|
0 commit comments