@@ -200,7 +200,6 @@ func.func @tensor.reshape_num_elements_mismatch(
200
200
func.func @extract_slice_wrong_result_rank (%t: tensor <?xf32 >, %idx : index ) {
201
201
// expected-error @+1 {{expected rank to be smaller or equal to the other rank.}}
202
202
%0 = tensor.extract_slice %t [0 ][4 ][1 ] : tensor <?xf32 > to tensor <?x?xf32 >
203
-
204
203
return
205
204
}
206
205
@@ -209,7 +208,25 @@ func.func @extract_slice_wrong_result_rank(%t: tensor<?xf32>, %idx : index) {
209
208
func.func @extract_slice_wrong_result_rank (%t: tensor <?xf32 >, %idx : index ) {
210
209
// expected-error @+1 {{expected element type to be 'f32'}}
211
210
%0 = tensor.extract_slice %t [0 ][4 ][1 ] : tensor <?xf32 > to tensor <4 xi8 >
211
+ return
212
+ }
213
+
214
+
215
+ // -----
216
+
217
+ func.func @extract_slice_size_and_output_dim_mismatch_static_size (%t: tensor <16 xf32 >) {
218
+ // expected-error @+1 {{expected type to be 'tensor<4xf32>' or a rank-reduced version. (size mismatch)}}
219
+ %0 = tensor.extract_slice %t [0 ][4 ][1 ]
220
+ : tensor <16 xf32 > to tensor <6 xf32 >
221
+ return
222
+ }
223
+
224
+ // -----
212
225
226
+ func.func @extract_slice_size_and_output_dim_mismatch_dynamic_size (%t: tensor <?xf32 >, %idx : index ) {
227
+ // expected-error @+2 {{expected type to be 'tensor<?xf32>' or a rank-reduced version. (size mismatch)}}
228
+ %c4 = arith.constant 4 : index
229
+ %0 = tensor.extract_slice %t [0 ][%c4 ][1 ] : tensor <?xf32 > to tensor <4 xi8 >
213
230
return
214
231
}
215
232
@@ -219,7 +236,6 @@ func.func @extract_slice_wrong_static_type(%t: tensor<8x16x4xf32>, %idx : index)
219
236
// expected-error @+1 {{expected type to be 'tensor<?x4x4xf32>' or a rank-reduced version. (size mismatch)}}
220
237
%0 = tensor.extract_slice %t [0 , 0 , 0 ][%idx , 4 , 4 ][1 , 1 , 1 ]
221
238
: tensor <8 x16 x4 xf32 > to tensor <4 x4 x4 xf32 >
222
-
223
239
return
224
240
}
225
241
@@ -229,7 +245,14 @@ func.func @extract_slice_wrong_dynamic_type(%t: tensor<8x16x4xf32>, %idx : index
229
245
// expected-error @+1 {{expected type to be 'tensor<4x4x4xf32>' or a rank-reduced version. (size mismatch)}}
230
246
%0 = tensor.extract_slice %t [0 , 2 , 0 ][4 , 4 , 4 ][1 , 1 , 1 ]
231
247
: tensor <8 x16 x4 xf32 > to tensor <?x4 x4 xf32 >
248
+ return
249
+ }
232
250
251
+ // -----
252
+
253
+ func.func @illegal_num_offsets (%arg0 : tensor <?x?x?xf32 >, %arg1 : index , %arg2 : index ) {
254
+ // expected-error@+1 {{expected 3 offset values}}
255
+ %0 = tensor.extract_slice %arg0 [0 , 0 ] [%arg1 , %arg2 ] [1 , 1 ] : tensor <?x?x?xf32 > to tensor <?x?x?xf32 >
233
256
return
234
257
}
235
258
@@ -349,14 +372,6 @@ func.func @rank(%0: f32) {
349
372
350
373
// -----
351
374
352
- func.func @illegal_num_offsets (%arg0 : tensor <?x?x?xf32 >, %arg1 : index , %arg2 : index ) {
353
- // expected-error@+1 {{expected 3 offset values}}
354
- %0 = tensor.extract_slice %arg0 [0 , 0 ] [%arg1 , %arg2 ] [1 , 1 ] : tensor <?x?x?xf32 > to tensor <?x?x?xf32 >
355
- return
356
- }
357
-
358
- // -----
359
-
360
375
func.func @illegal_num_offsets (%arg0 : tensor <?x?xf32 >, %arg1 : tensor <?x?x?xf32 >,
361
376
%arg2 : index , %arg3 : index ) {
362
377
// expected-error@+1 {{expected 3 offset values}}
0 commit comments