7
7
from __future__ import print_function
8
8
from __future__ import unicode_literals
9
9
10
- import unittest
11
-
12
10
import numpy as np
13
11
from onnx import helper , TensorProto , OperatorSetIdProto
14
12
from tf2onnx import utils
@@ -1099,10 +1097,9 @@ def test_transpose_back_to_back_non_const(self):
1099
1097
1100
1098
model_proto = self .make_model (graph , producer_name = "onnx-tests" )
1101
1099
self .run_transpose_compare (["res" ], {"u" : np .random .randn (5 , 5 , 5 , 5 ).astype (np .float32 )},
1102
- model_proto , remaining_transpose_num = 2 )
1100
+ model_proto , remaining_transpose_num = 1 )
1103
1101
1104
- # @check_opset_min_version(9, "string type tensor")
1105
- @unittest .skip ("FIXME: disabled because of crash on linux/ortnightly" )
1102
+ @check_opset_min_version (9 , "string type tensor" )
1106
1103
def test_cast_back_to_back_non_const_mixed_types (self ):
1107
1104
node0 = helper .make_node ("Cast" , ["u" ], ["v" ], to = 11 , name = "cast_0" ) # double
1108
1105
node1 = helper .make_node ("Cast" , ["v" ], ["w" ], to = 6 , name = "cast_1" ) # int32
@@ -1113,11 +1110,13 @@ def test_cast_back_to_back_non_const_mixed_types(self):
1113
1110
node5 = helper .make_node ("Cast" , ["w2" ], ["res2" ], to = 7 , name = "cast_5" ) # int64
1114
1111
1115
1112
node6 = helper .make_node ("Cast" , ["x" ], ["x2" ], to = 9 , name = "cast_6" ) # bool
1116
- node7 = helper .make_node ("Cast" , ["x2" ], ["x3" ], to = 8 , name = "cast_7" ) # string
1117
- node8 = helper .make_node ("Cast" , ["x3" ], ["res3" ], to = 3 , name = "cast_8" ) # int8
1113
+ # TODO: uncomment below after fix
1114
+ # https://github.com/microsoft/onnxruntime/issues/2338
1115
+ # node7 = helper.make_node("Cast", ["x2"], ["x3"], to=8, name="cast_7") # string
1116
+ node8 = helper .make_node ("Cast" , ["x2" ], ["res3" ], to = 3 , name = "cast_8" ) # int8
1118
1117
1119
1118
graph = helper .make_graph (
1120
- [node0 , node1 , node2 , node3 , node4 , node5 , node6 , node7 , node8 ],
1119
+ [node0 , node1 , node2 , node3 , node4 , node5 , node6 , node8 ],
1121
1120
"test-cast-back-to-back-non-const" ,
1122
1121
[helper .make_tensor_value_info ("u" , TensorProto .FLOAT , (1 , 2 , 3 ))],
1123
1122
[helper .make_tensor_value_info ("res" , TensorProto .INT64 , (1 , 2 , 3 )),
0 commit comments