File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,8 @@ def onnx_export(
78
78
export_options = export_options ,
79
79
)
80
80
export_output .save (output_file )
81
- torch_out = None
82
81
else :
83
- torch_out = torch .onnx .export (
82
+ torch .onnx .export (
84
83
model ,
85
84
example_input ,
86
85
output_file ,
@@ -101,9 +100,5 @@ def onnx_export(
101
100
if check_forward and not training :
102
101
import numpy as np
103
102
onnx_out = onnx_forward (output_file , example_input )
104
- if torch_out is not None :
105
- np .testing .assert_almost_equal (torch_out .numpy (), onnx_out , decimal = 3 )
106
- np .testing .assert_almost_equal (original_out .numpy (), torch_out .numpy (), decimal = 5 )
107
- else :
108
- np .testing .assert_almost_equal (original_out .numpy (), onnx_out , decimal = 3 )
103
+ np .testing .assert_almost_equal (original_out .numpy (), onnx_out , decimal = 3 )
109
104
You can’t perform that action at this time.
0 commit comments