@@ -596,6 +596,15 @@ def test_min(self):
596
596
_ = tf .identity (mi , name = _TFOUTPUT )
597
597
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val1 , _INPUT1 : x_val2 })
598
598
599
+ tf .reset_default_graph ()
600
+ x_val1 = np .array ([4.0 , 16.0 , 4.0 , 1.6 ], dtype = np .int32 ).reshape ((2 , 2 ))
601
+ x_val2 = np .array ([4.0 , 4.0 , 4.0 , 4.0 ], dtype = np .int32 ).reshape ((2 , 2 ))
602
+ x1 = tf .placeholder (tf .int32 , x_val1 .shape , name = _TFINPUT )
603
+ x2 = tf .placeholder (tf .int32 , x_val2 .shape , name = _TFINPUT1 )
604
+ mi = tf .minimum (x1 , x2 )
605
+ _ = tf .identity (mi , name = _TFOUTPUT )
606
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val1 , _INPUT1 : x_val2 })
607
+
599
608
@skip_caffe2_backend ("issue with broadcasting scalar" )
600
609
@check_onnxruntime_incompatibility ("Sub" )
601
610
def test_min_broadcast (self ):
@@ -788,6 +797,35 @@ def test_concat(self):
788
797
_ = tf .identity (x_ , name = _TFOUTPUT )
789
798
self ._run_test_case ([_OUTPUT ], {_INPUT : x_val1 , _INPUT1 : x_val2 , "input3:0" : x_val3 })
790
799
800
+ def test_concat_empty_const_input (self ):
801
+ x_val1 = np .array ([1 , 2 , 3 ], dtype = np .float32 )
802
+ x_val2 = np .array ([], dtype = np .float32 )
803
+ x1 = tf .placeholder (tf .float32 , x_val1 .shape , name = _TFINPUT )
804
+ x2 = tf .constant (x_val2 , dtype = tf .float32 )
805
+ x_ = tf .concat ([x1 , x2 ], 0 )
806
+ _ = tf .identity (x_ , name = _TFOUTPUT )
807
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val1 })
808
+
809
+ tf .reset_default_graph ()
810
+ x_val1 = np .array ([[1 , 2 , 3 ]], dtype = np .float32 )
811
+ x_val2 = np .array ([[]], dtype = np .float32 )
812
+ x1 = tf .placeholder (tf .float32 , x_val1 .shape , name = _TFINPUT )
813
+ x2 = tf .constant (x_val2 , dtype = tf .float32 )
814
+ x_ = tf .concat ([x1 , x2 ], 1 )
815
+ _ = tf .identity (x_ , name = _TFOUTPUT )
816
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val1 })
817
+
818
+ tf .reset_default_graph ()
819
+ x_val1 = np .array ([1 , 2 , 3 ], dtype = np .float32 )
820
+ x_val2 = np .array ([], dtype = np .float32 )
821
+ x_val3 = np .array ([13 , 14 , 15 ], dtype = np .float32 )
822
+ x1 = tf .placeholder (tf .float32 , x_val1 .shape , name = _TFINPUT )
823
+ x2 = tf .constant (x_val2 , dtype = tf .float32 )
824
+ x3 = tf .placeholder (tf .float32 , x_val3 .shape , name = _TFINPUT1 )
825
+ x_ = tf .concat ([x1 , x2 , x3 ], 0 )
826
+ _ = tf .identity (x_ , name = _TFOUTPUT )
827
+ self ._run_test_case ([_OUTPUT ], {_INPUT : x_val1 , _INPUT1 : x_val3 })
828
+
791
829
@check_opset_min_version (6 , "cast" )
792
830
def test_concat_int64 (self ):
793
831
x_val1 = np .array ([[1 , 2 , 3 ], [4 , 5 , 6 ]], dtype = np .int64 )
0 commit comments