@@ -2404,7 +2404,10 @@ func.func @test_leaky_relu_qi16(%arg0: tensor<14x19x!quant.uniform<i16:f32, 0.01
2404
2404
// -----
2405
2405
2406
2406
// CHECK-LABEL: test_resize_bilinear_qi8
2407
- // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0 {border = array<i64: 14, 14>, mode = "BILINEAR", offset = array<i64: 0, 0>, scale = array<i64: 16, 2, 16, 2>}
2407
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[16, 2, 16, 2]> : tensor<4xindex>} : () -> !tosa.shape<4>
2408
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2409
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<14> : tensor<2xindex>} : () -> !tosa.shape<2>
2410
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "BILINEAR"}
2408
2411
// CHECK: %[[VAR2:.*]] = tosa.rescale %[[VAR1]] {double_round = false, input_zp = 0 : i32, multiplier = array<i32: 1073741824>, output_zp = 0 : i32, per_channel = false, scale32 = true, shift = array<i8: 38>}
2409
2412
func.func @test_resize_bilinear_qi8 (%arg0: tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >> {
2410
2413
%0 = " tfl.pseudo_const" () {value = dense <640 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
@@ -2415,7 +2418,10 @@ func.func @test_resize_bilinear_qi8(%arg0: tensor<1x80x80x2x!quant.uniform<i8:f3
2415
2418
// -----
2416
2419
2417
2420
// CHECK-LABEL: test_resize_bilinear_half_qi8
2418
- // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0 {border = array<i64: 7, 7>, mode = "BILINEAR", offset = array<i64: -7, -7>, scale = array<i64: 16, 2, 16, 2>}
2421
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[16, 2, 16, 2]> : tensor<4xindex>} : () -> !tosa.shape<4>
2422
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<-7> : tensor<2xindex>} : () -> !tosa.shape<2>
2423
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<7> : tensor<2xindex>} : () -> !tosa.shape<2>
2424
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "BILINEAR"}
2419
2425
func.func @test_resize_bilinear_half_qi8 (%arg0: tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >> {
2420
2426
%0 = " tfl.pseudo_const" () {value = dense <640 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2421
2427
%1 = " tfl.resize_bilinear" (%arg0 , %0 ) {align_corners = false , half_pixel_centers = true } : (tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>, tensor <2 xi32 >) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>
@@ -2425,7 +2431,9 @@ func.func @test_resize_bilinear_half_qi8(%arg0: tensor<1x80x80x2x!quant.uniform<
2425
2431
// -----
2426
2432
2427
2433
// CHECK-LABEL: test_resize_bilinear_align_qi8
2428
- // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0 {border = array<i64: 0, 0>, mode = "BILINEAR", offset = array<i64: 0, 0>, scale = array<i64: 1278, 158, 1278, 158>}
2434
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[1278, 158, 1278, 158]> : tensor<4xindex>} : () -> !tosa.shape<4>
2435
+ // CHECK-DAG: %[[CONST0:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2436
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[CONST0]], %[[CONST0]] {mode = "BILINEAR"}
2429
2437
func.func @test_resize_bilinear_align_qi8 (%arg0: tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >> {
2430
2438
%0 = " tfl.pseudo_const" () {value = dense <640 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2431
2439
%1 = " tfl.resize_bilinear" (%arg0 , %0 ) {align_corners = true , half_pixel_centers = false } : (tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>, tensor <2 xi32 >) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>
@@ -2435,7 +2443,9 @@ func.func @test_resize_bilinear_align_qi8(%arg0: tensor<1x80x80x2x!quant.uniform
2435
2443
// -----
2436
2444
2437
2445
// CHECK-LABEL: test_resize_bilinear_align_half_qi8
2438
- // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0 {border = array<i64: -560, -560>, mode = "BILINEAR", offset = array<i64: -560, -560>, scale = array<i64: 1278, 158, 1278, 158>}
2446
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[1278, 158, 1278, 158]> : tensor<4xindex>} : () -> !tosa.shape<4>
2447
+ // CHECK-DAG: %[[KM560:.*]] = tosa.const_shape {value = dense<-560> : tensor<2xindex>} : () -> !tosa.shape<2>
2448
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[KM560]], %[[KM560]] {mode = "BILINEAR"}
2439
2449
func.func @test_resize_bilinear_align_half_qi8 (%arg0: tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >> {
2440
2450
%0 = " tfl.pseudo_const" () {value = dense <640 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2441
2451
%1 = " tfl.resize_bilinear" (%arg0 , %0 ) {align_corners = true , half_pixel_centers = true } : (tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>, tensor <2 xi32 >) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>
@@ -2445,7 +2455,10 @@ func.func @test_resize_bilinear_align_half_qi8(%arg0: tensor<1x80x80x2x!quant.un
2445
2455
// -----
2446
2456
2447
2457
// CHECK-LABEL: test_resize_nearest_qi8
2448
- // CHECK: %[[VAR1:.*]] = tosa.resize %arg0 {border = array<i64: 14, 14>, mode = "NEAREST_NEIGHBOR", offset = array<i64: 0, 0>, scale = array<i64: 16, 2, 16, 2>}
2458
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[16, 2, 16, 2]> : tensor<4xindex>} : () -> !tosa.shape<4>
2459
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2460
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<14> : tensor<2xindex>} : () -> !tosa.shape<2>
2461
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "NEAREST_NEIGHBOR"}
2449
2462
func.func @test_resize_nearest_qi8 (%arg0: tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >> {
2450
2463
%0 = " tfl.pseudo_const" () {value = dense <640 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2451
2464
%1 = " tfl.resize_nearest_neighbor" (%arg0 , %0 ) {align_corners = false , half_pixel_centers = false } : (tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>, tensor <2 xi32 >) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>
@@ -2456,7 +2469,10 @@ func.func @test_resize_nearest_qi8(%arg0: tensor<1x80x80x2x!quant.uniform<i8:f32
2456
2469
// -----
2457
2470
2458
2471
// CHECK-LABEL: test_resize_nearest_half_qi8
2459
- // CHECK: %[[VAR1:.*]] = tosa.resize %arg0 {border = array<i64: 15, 15>, mode = "NEAREST_NEIGHBOR", offset = array<i64: 1, 1>, scale = array<i64: 16, 2, 16, 2>}
2472
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[16, 2, 16, 2]> : tensor<4xindex>} : () -> !tosa.shape<4>
2473
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<1> : tensor<2xindex>} : () -> !tosa.shape<2>
2474
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<15> : tensor<2xindex>} : () -> !tosa.shape<2>
2475
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "NEAREST_NEIGHBOR"}
2460
2476
func.func @test_resize_nearest_half_qi8 (%arg0: tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >> {
2461
2477
%0 = " tfl.pseudo_const" () {value = dense <640 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2462
2478
%1 = " tfl.resize_nearest_neighbor" (%arg0 , %0 ) {align_corners = false , half_pixel_centers = true } : (tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>, tensor <2 xi32 >) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>
@@ -2466,7 +2482,9 @@ func.func @test_resize_nearest_half_qi8(%arg0: tensor<1x80x80x2x!quant.uniform<i
2466
2482
// -----
2467
2483
2468
2484
// CHECK-LABEL: test_resize_nearest_align_qi8
2469
- // CHECK: %[[VAR1:.*]] = tosa.resize %arg0 {border = array<i64: 639, 639>, mode = "NEAREST_NEIGHBOR", offset = array<i64: 639, 639>, scale = array<i64: 1278, 158, 1278, 158>}
2485
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[1278, 158, 1278, 158]> : tensor<4xindex>} : () -> !tosa.shape<4>
2486
+ // CHECK-DAG: %[[K639:.*]] = tosa.const_shape {value = dense<639> : tensor<2xindex>} : () -> !tosa.shape<2>
2487
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[K639]], %[[K639]] {mode = "NEAREST_NEIGHBOR"}
2470
2488
func.func @test_resize_nearest_align_qi8 (%arg0: tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >> {
2471
2489
%0 = " tfl.pseudo_const" () {value = dense <640 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2472
2490
%1 = " tfl.resize_nearest_neighbor" (%arg0 , %0 ) {align_corners = true , half_pixel_centers = false } : (tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>, tensor <2 xi32 >) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>
@@ -2476,7 +2494,9 @@ func.func @test_resize_nearest_align_qi8(%arg0: tensor<1x80x80x2x!quant.uniform<
2476
2494
// -----
2477
2495
2478
2496
// CHECK-LABEL: test_resize_nearest_align_half_qi8
2479
- // CHECK: %[[VAR1:.*]] = tosa.resize %arg0 {border = array<i64: 718, 718>, mode = "NEAREST_NEIGHBOR", offset = array<i64: 718, 718>, scale = array<i64: 1278, 158, 1278, 158>}
2497
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[1278, 158, 1278, 158]> : tensor<4xindex>} : () -> !tosa.shape<4>
2498
+ // CHECK-DAG: %[[K718:.*]] = tosa.const_shape {value = dense<718> : tensor<2xindex>} : () -> !tosa.shape<2>
2499
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[K718]], %[[K718]] {mode = "NEAREST_NEIGHBOR"}
2480
2500
func.func @test_resize_nearest_align_half_qi8 (%arg0: tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >> {
2481
2501
%0 = " tfl.pseudo_const" () {value = dense <640 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2482
2502
%1 = " tfl.resize_nearest_neighbor" (%arg0 , %0 ) {align_corners = true , half_pixel_centers = true } : (tensor <1 x80 x80 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>, tensor <2 xi32 >) -> tensor <1 x640 x640 x2 x!quant.uniform <i8 :f32 , 0.42546585202217102 >>
@@ -2486,7 +2506,10 @@ func.func @test_resize_nearest_align_half_qi8(%arg0: tensor<1x80x80x2x!quant.uni
2486
2506
// -----
2487
2507
2488
2508
// CHECK-LABEL: test_resize_bilinear_f32_scalar_input
2489
- // CHECK: %[[VAL_1:.*]] = tosa.resize %arg0 {border = array<i64: 1, 1>, mode = "BILINEAR", offset = array<i64: 0, 0>, scale = array<i64: 2, 1, 2, 1>}
2509
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[2, 1, 2, 1]> : tensor<4xindex>} : () -> !tosa.shape<4>
2510
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2511
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<1> : tensor<2xindex>} : () -> !tosa.shape<2>
2512
+ // CHECK-DAG: %[[VAR1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "BILINEAR"}
2490
2513
func.func @test_resize_bilinear_f32_scalar_input (%arg0: tensor <3 x1 x1 x7 xf32 >) -> tensor <3 x2 x2 x7 xf32 > {
2491
2514
%0 = " tfl.pseudo_const" () {value = dense <2 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2492
2515
%1 = " tfl.resize_bilinear" (%arg0 , %0 ) {align_corners = false , half_pixel_centers = false } : (tensor <3 x1 x1 x7 xf32 >, tensor <2 xi32 >) -> tensor <3 x2 x2 x7 xf32 >
@@ -2496,7 +2519,10 @@ func.func @test_resize_bilinear_f32_scalar_input(%arg0: tensor<3x1x1x7xf32>) ->
2496
2519
// -----
2497
2520
2498
2521
// CHECK-LABEL: test_resize_bilinear_half_qi8_scalar_input
2499
- // CHECK: %[[VAL_1:.*]] = tosa.resize %arg0 {border = array<i64: 1, 1>, mode = "BILINEAR", offset = array<i64: 0, 0>, scale = array<i64: 2, 1, 2, 1>}
2522
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[2, 1, 2, 1]> : tensor<4xindex>} : () -> !tosa.shape<4>
2523
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2524
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<1> : tensor<2xindex>} : () -> !tosa.shape<2>
2525
+ // CHECK-DAG: %[[VAL_1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "BILINEAR"}
2500
2526
// CHECK: %[[VAL_2:.*]] = tosa.rescale %[[VAL_1]] {double_round = false, input_zp = 0 : i32, multiplier = array<i32: 1073741824>, output_zp = 0 : i32, per_channel = false, scale32 = true, shift = array<i8: 32>}
2501
2527
func.func @test_resize_bilinear_half_qi8_scalar_input (%arg0: tensor <3 x1 x1 x7 x!quant.uniform <i8 :f32 , 0.1 >>) -> tensor <3 x2 x2 x7 x!quant.uniform <i8 :f32 , 0.1 >> {
2502
2528
%0 = " tfl.pseudo_const" () {value = dense <2 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
@@ -2507,7 +2533,10 @@ func.func @test_resize_bilinear_half_qi8_scalar_input(%arg0: tensor<3x1x1x7x!qua
2507
2533
// -----
2508
2534
2509
2535
// CHECK-LABEL: test_resize_bilinear_align_qi8_scalar_input
2510
- // CHECK: %[[VAL_1:.*]] = tosa.resize %arg0 {border = array<i64: 1, 1>, mode = "BILINEAR", offset = array<i64: 0, 0>, scale = array<i64: 2, 1, 2, 1>}
2536
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[2, 1, 2, 1]> : tensor<4xindex>} : () -> !tosa.shape<4>
2537
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2538
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<1> : tensor<2xindex>} : () -> !tosa.shape<2>
2539
+ // CHECK-DAG: %[[VAL_1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "BILINEAR"}
2511
2540
// CHECK: %[[VAL_2:.*]] = tosa.rescale %[[VAL_1]] {double_round = false, input_zp = 0 : i32, multiplier = array<i32: 1073741824>, output_zp = 0 : i32, per_channel = false, scale32 = true, shift = array<i8: 32>}
2512
2541
func.func @test_resize_bilinear_align_qi8_scalar_input (%arg0: tensor <3 x1 x1 x7 x!quant.uniform <i8 :f32 , 0.1 >>) -> tensor <3 x2 x2 x7 x!quant.uniform <i8 :f32 , 0.1 >> {
2513
2542
%0 = " tfl.pseudo_const" () {value = dense <2 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
@@ -2518,7 +2547,10 @@ func.func @test_resize_bilinear_align_qi8_scalar_input(%arg0: tensor<3x1x1x7x!qu
2518
2547
// -----
2519
2548
2520
2549
// CHECK-LABEL: test_resize_nearest_f32_scalar_input
2521
- // CHECK: %[[VAL_1:.*]] = tosa.resize %arg0 {border = array<i64: 1, 1>, mode = "NEAREST_NEIGHBOR", offset = array<i64: 0, 0>, scale = array<i64: 2, 1, 2, 1>}
2550
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[2, 1, 2, 1]> : tensor<4xindex>} : () -> !tosa.shape<4>
2551
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2552
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<1> : tensor<2xindex>} : () -> !tosa.shape<2>
2553
+ // CHECK-DAG: %[[VAL_1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "NEAREST_NEIGHBOR"}
2522
2554
func.func @test_resize_nearest_f32_scalar_input (%arg0: tensor <3 x1 x1 x7 xf32 >) -> tensor <3 x2 x2 x7 xf32 > {
2523
2555
%0 = " tfl.pseudo_const" () {value = dense <2 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2524
2556
%1 = " tfl.resize_nearest_neighbor" (%arg0 , %0 ) {align_corners = false , half_pixel_centers = false } : (tensor <3 x1 x1 x7 xf32 >, tensor <2 xi32 >) -> tensor <3 x2 x2 x7 xf32 >
@@ -2528,7 +2560,10 @@ func.func @test_resize_nearest_f32_scalar_input(%arg0: tensor<3x1x1x7xf32>) -> t
2528
2560
// -----
2529
2561
2530
2562
// CHECK-LABEL: test_resize_nearest_half_qi8_scalar_input
2531
- // CHECK: %[[VAL_1:.*]] = tosa.resize %arg0 {border = array<i64: 1, 1>, mode = "NEAREST_NEIGHBOR", offset = array<i64: 0, 0>, scale = array<i64: 2, 1, 2, 1>}
2563
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[2, 1, 2, 1]> : tensor<4xindex>} : () -> !tosa.shape<4>
2564
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2565
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<1> : tensor<2xindex>} : () -> !tosa.shape<2>
2566
+ // CHECK-DAG: %[[VAL_1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "NEAREST_NEIGHBOR"}
2532
2567
func.func @test_resize_nearest_half_qi8_scalar_input (%arg0: tensor <3 x1 x1 x7 x!quant.uniform <i8 :f32 , 0.1 >>) -> tensor <3 x2 x2 x7 x!quant.uniform <i8 :f32 , 0.1 >> {
2533
2568
%0 = " tfl.pseudo_const" () {value = dense <2 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2534
2569
%1 = " tfl.resize_nearest_neighbor" (%arg0 , %0 ) {align_corners = false , half_pixel_centers = true } : (tensor <3 x1 x1 x7 x!quant.uniform <i8 :f32 , 0.1 >>, tensor <2 xi32 >) -> tensor <3 x2 x2 x7 x!quant.uniform <i8 :f32 , 0.1 >>
@@ -2538,7 +2573,10 @@ func.func @test_resize_nearest_half_qi8_scalar_input(%arg0: tensor<3x1x1x7x!quan
2538
2573
// -----
2539
2574
2540
2575
// CHECK-LABEL: test_resize_nearest_align_qi8_scalar_input
2541
- // CHECK: %[[VAL_1:.*]] = tosa.resize %arg0 {border = array<i64: 1, 1>, mode = "NEAREST_NEIGHBOR", offset = array<i64: 0, 0>, scale = array<i64: 2, 1, 2, 1>}
2576
+ // CHECK-DAG: %[[SCALE:.*]] = tosa.const_shape {value = dense<[2, 1, 2, 1]> : tensor<4xindex>} : () -> !tosa.shape<4>
2577
+ // CHECK-DAG: %[[OFFSET:.*]] = tosa.const_shape {value = dense<0> : tensor<2xindex>} : () -> !tosa.shape<2>
2578
+ // CHECK-DAG: %[[BORDER:.*]] = tosa.const_shape {value = dense<1> : tensor<2xindex>} : () -> !tosa.shape<2>
2579
+ // CHECK-DAG: %[[VAL_1:.*]] = tosa.resize %arg0, %[[SCALE]], %[[OFFSET]], %[[BORDER]] {mode = "NEAREST_NEIGHBOR"}
2542
2580
func.func @test_resize_nearest_align_qi8_scalar_input (%arg0: tensor <3 x1 x1 x7 x!quant.uniform <i8 :f32 , 0.1 >>) -> tensor <3 x2 x2 x7 x!quant.uniform <i8 :f32 , 0.1 >> {
2543
2581
%0 = " tfl.pseudo_const" () {value = dense <2 > : tensor <2 xi32 >} : () -> tensor <2 xi32 >
2544
2582
%1 = " tfl.resize_nearest_neighbor" (%arg0 , %0 ) {align_corners = true , half_pixel_centers = false } : (tensor <3 x1 x1 x7 x!quant.uniform <i8 :f32 , 0.1 >>, tensor <2 xi32 >) -> tensor <3 x2 x2 x7 x!quant.uniform <i8 :f32 , 0.1 >>
0 commit comments