Skip to content

Commit 41bc308

Browse files
authored
[TorchToTosa] Fix transposed_conv1d case in basic.mlir (#4629)
Use CHECK-DAG for SLICE_START and SLICE_SIZE since the order of these in the produced MLIR can differ between platforms.
1 parent 107be01 commit 41bc308

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/Conversion/TorchToTosa/basic.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4605,8 +4605,8 @@ func.func @torch.aten.convolution$depthwise_conv1d(%arg0: !torch.vtensor<[2,3,9]
46054605
// CHECK: %[[NHWC_INPUT:.*]] = tosa.transpose %[[FAKE_INPUT]] {perms = array<i32: 0, 2, 3, 1>} : (tensor<1x1x1x7xf32>) -> tensor<1x1x7x1xf32>
46064606
// CHECK: %[[OHWI_WEIGHT:.*]] = tosa.transpose %[[FAKE_WEIGHT]] {perms = array<i32: 1, 2, 3, 0>} : (tensor<1x2x1x3xf32>) -> tensor<2x1x3x1xf32>
46074607
// CHECK: %[[TRANSPOSED:.*]] = tosa.transpose_conv2d %[[NHWC_INPUT]], %[[OHWI_WEIGHT]], %[[BIAS]], %[[INPUT_ZP]], %[[WEIGHT_ZP]] {acc_type = f32, out_pad = array<i64: 0, 0, 0, 0>, stride = array<i64: 1, 4>} : (tensor<1x1x7x1xf32>, tensor<2x1x3x1xf32>, tensor<2xf32>, tensor<1xf32>, tensor<1xf32>) -> tensor<1x1x27x2xf32>
4608-
// CHECK: %[[SLICE_START:.*]] = tosa.const_shape {values = dense<[0, 0, 3, 0]> : tensor<4xindex>} : () -> !tosa.shape<4>
4609-
// CHECK: %[[SLICE_SIZE:.*]] = tosa.const_shape {values = dense<[1, 1, 21, 2]> : tensor<4xindex>} : () -> !tosa.shape<4>
4608+
// CHECK-DAG: %[[SLICE_START:.*]] = tosa.const_shape {values = dense<[0, 0, 3, 0]> : tensor<4xindex>} : () -> !tosa.shape<4>
4609+
// CHECK-DAG: %[[SLICE_SIZE:.*]] = tosa.const_shape {values = dense<[1, 1, 21, 2]> : tensor<4xindex>} : () -> !tosa.shape<4>
46104610
// CHECK: %[[SLICED:.*]] = tosa.slice %[[TRANSPOSED]], %[[SLICE_START]], %[[SLICE_SIZE]] : (tensor<1x1x27x2xf32>, !tosa.shape<4>, !tosa.shape<4>) -> tensor<1x1x21x2xf32>
46114611
// CHECK: %[[NCHW_OUTPUT:.*]] = tosa.transpose %[[SLICED]] {perms = array<i32: 0, 3, 1, 2>} : (tensor<1x1x21x2xf32>) -> tensor<1x2x1x21xf32>
46124612
// CHECK: %[[OUTPUT_SHAPE:.*]] = tosa.const_shape {values = dense<[1, 2, 21]> : tensor<3xindex>} : () -> !tosa.shape<3>

0 commit comments

Comments
 (0)