@@ -572,11 +572,11 @@ func.func @test_concatfuse_2(%arg0: tensor<?x20xf32>, %arg1: tensor<?x30xf32>) -
572572
573573// -----
574574
575- func.func @test_constantofshape (%arg0: tensor <?xi64 >) -> tensor <*xi32 > {
575+ func.func @test_constantofshape_1 (%arg0: tensor <?xi64 >) -> tensor <*xi32 > {
576576 %0 = onnx.ConstantOfShape (%arg0 ) {value = dense <1 > : tensor <1 xi32 >} : (tensor <?xi64 >) -> tensor <*xi32 >
577577 return %0 : tensor <*xi32 >
578578
579- // CHECK-LABEL: func.func @test_constantofshape
579+ // CHECK-LABEL: func.func @test_constantofshape_1
580580// CHECK-SAME: ([[PARAM_0_:%.+]]: tensor<?xi64>) -> tensor<*xi32> {
581581// CHECK: [[VAR_0_:%.+]] = onnx.Constant dense<1> : tensor<i32>
582582// CHECK: [[VAR_1_:%.+]] = "onnx.Expand"([[VAR_0_]], [[PARAM_0_]]) : (tensor<i32>, tensor<?xi64>) -> tensor<*xi32>
@@ -586,6 +586,20 @@ func.func @test_constantofshape(%arg0: tensor<?xi64>) -> tensor<*xi32> {
586586
587587// -----
588588
589+ func.func @test_constantofshape_2 (%arg0: tensor <?xi64 >) -> tensor <*xi32 > {
590+ %0 = onnx.ConstantOfShape (%arg0 ) : (tensor <?xi64 >) -> tensor <*xi32 >
591+ return %0 : tensor <*xi32 >
592+
593+ // CHECK-LABEL: func.func @test_constantofshape_2
594+ // CHECK-SAME: ([[PARAM_0_:%.+]]: tensor<?xi64>) -> tensor<*xi32> {
595+ // CHECK: [[VAR_0_:%.+]] = onnx.Constant dense<0.000000e+00> : tensor<f32>
596+ // CHECK: [[VAR_1_:%.+]] = "onnx.Expand"([[VAR_0_]], [[PARAM_0_]]) : (tensor<f32>, tensor<?xi64>) -> tensor<*xi32>
597+ // CHECK: return [[VAR_1_]] : tensor<*xi32>
598+ // CHECK: }
599+ }
600+
601+ // -----
602+
589603func.func @test_hardswish_f32 (%arg0: tensor <?x?x?xf32 >) -> tensor <?x?x?xf32 > {
590604 %0 = " onnx.HardSwish" (%arg0 ) : (tensor <?x?x?xf32 >) -> tensor <?x?x?xf32 >
591605 return %0 : tensor <?x?x?xf32 >
0 commit comments