Skip to content

Commit a1423ba

Browse files
authored
[mlir][tensor] Fix integration tests that uses reshape ops. (#90649)
Due to generalization introduced in #90040
1 parent 4e6f6fd commit a1423ba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mlir/test/Integration/Dialect/Linalg/CPU/test-expand-tensor.mlir

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ func.func @main() {
3535
func.func private @printMemrefF32(%ptr : tensor<*xf32>)
3636

3737
func.func @expand_dynamic_shape(%arg0 : tensor<2x?x?xf32>) -> tensor<2x2x?x1x?xf32> {
38-
%0 = tensor.expand_shape %arg0 [[0], [1, 2, 3], [4]]: tensor<2x?x?xf32> into tensor<2x2x?x1x?xf32>
38+
%c0 = arith.constant 0 : index
39+
%c1 = arith.constant 1 : index
40+
%c2 = arith.constant 2 : index
41+
%d1 = tensor.dim %arg0, %c1 : tensor<2x?x?xf32>
42+
%d2 = tensor.dim %arg0, %c2 : tensor<2x?x?xf32>
43+
%sz1 = arith.divui %d1, %c2 : index
44+
%0 = tensor.expand_shape %arg0 [[0], [1, 2, 3], [4]] output_shape [2, 2, %sz1, 1, %d2] : tensor<2x?x?xf32> into tensor<2x2x?x1x?xf32>
3945
return %0 : tensor<2x2x?x1x?xf32>
4046
}

0 commit comments

Comments
 (0)