Lines Matching full:tensor

4 func.func @dim_0_ranked(%arg : tensor<f32>, %arg1 : index) {
5 tensor.dim %arg, %arg1 : tensor<f32> // expected-error {{'tensor.dim' op operand #0 must be non-0-ranked or unranked tensor, but got 'tensor<f32>'}}
11 func.func @tensor.cast_mismatching_constants(%arg0: tensor<1xf32>) {
12 // expected-error@+1 {{operand type 'tensor<1xf32>' and result type 'tensor<2xf32>' are cast incompatible}}
13 %0 = tensor.cast %arg0 : tensor<1xf32> to tensor<2xf32>
21 %0 = tensor.concat dim(0) : () -> tensor<1x2x3xf32>
27 func.func @concat_rank_mismatch(%arg0: tensor<1xf32>, %arg1: tensor<1xf32>) {
29 %0 = tensor.concat dim(0) %arg0, %arg1 : (tensor<1xf32>, tensor<1xf32>) -> tensor<2x1xf32>
35 func.func @concat_dim_out_of_range(%arg0: tensor<3xf32>) {
36 // expected-error@+1 {{concatenation dim must be less than the tensor rank}}
37 %0 = tensor.concat dim(1) %arg0 : (tensor<3xf32>) -> tensor<3xf32>
43 func.func @concat_element_type_mismatch(%arg0: tensor<3xf32>, %arg1: tensor<3xi32>) {
45 %0 = tensor.concat dim(0) %arg0, %arg1 : (tensor<3xf32>, tensor<3xi32>) -> tensor<3xf32>
51 func.func @concat_incompatible_input_types(%arg0: tensor<3x4xf32>, %arg1: tensor<4x5xf32>) {
53 %0 = tensor.concat dim(0) %arg0, %arg1 : (tensor<3x4xf32>, tensor<4x5xf32>) -> tensor<7x5xf32>
59 func.func @concat_static_shape_mismatch(%arg0: tensor<3xf32>) {
60 // expected-error@+1 {{result type 'tensor<7xf32>'does not match inferred shape 'tensor<6xf32>' static sizes}}
61 %0 = tensor.concat dim(0) %arg0, %arg0 : (tensor<3xf32>, tensor<3xf32>) -> tensor<7xf32>
67 func.func @extract_too_many_indices(%arg0: tensor<?xf32>) {
69 %0 = tensor.extract %arg0[] : tensor<?xf32>
75 func.func @insert_too_many_indices(%arg0: f32, %arg1: tensor<?xf32>) {
77 %0 = tensor.insert %arg0 into %arg1[] : tensor<?xf32>
83 func.func @tensor.from_elements_wrong_result_type() {
84 // expected-error@+2 {{'tensor.from_elements' invalid kind of type specified}}
86 %0 = tensor.from_elements %c0 : tensor<*xi32>
92 func.func @tensor.from_elements_wrong_elements_count() {
95 %0 = tensor.from_elements %c0 : tensor<2xindex>
101 func.func @tensor.generate(%m : index)
102 -> tensor<?x3x?xf32> {
104 %tnsr = tensor.generate %m {
107 tensor.yield %elem : f32
108 } : tensor<?x3x?xf32>
109 return %tnsr : tensor<?x3x?xf32>
114 func.func @tensor.generate(%m : index, %n : index)
115 -> tensor<?x3x?xf32> {
117 %tnsr = tensor.generate %m, %n {
120 tensor.yield %elem : f32
121 } : tensor<?x3x?xf32>
122 return %tnsr : tensor<?x3x?xf32>
127 func.func @tensor.generate(%m : index, %n : index)
128 -> tensor<?x3x?xf32> {
130 %tnsr = tensor.generate %m, %n {
133 tensor.yield %elem : f32
134 } : tensor<?x3x?xf32>
135 return %tnsr : tensor<?x3x?xf32>
140 func.func @tensor.generate(%m : index, %n : index)
141 -> tensor<?x3x?xf32> {
143 %tnsr = tensor.generate %m, %n {
147 } : tensor<?x3x?xf32>
148 return %tnsr : tensor<?x3x?xf32>
153 func.func @tensor.generate(%m : index, %n : index)
154 -> tensor<?x3x?xf32> {
155 // expected-error @+1 {{body must be terminated with a `yield` operation of the tensor element type}}
156 %tnsr = tensor.generate %m, %n {
159 tensor.yield %elem : i32
160 } : tensor<?x3x?xf32>
161 return %tnsr : tensor<?x3x?xf32>
166 func.func @tensor.reshape_element_type_mismatch(
167 %buf: tensor<*xf32>, %shape: tensor<1xi32>) {
168 // expected-error @+1 {{element types of source and destination tensor types should be the same}}
169 tensor.reshape %buf(%shape) : (tensor<*xf32>, tensor<1xi32>) -> tensor<?xi32>
174 func.func @tensor.reshape_dst_ranked_shape_unranked(
175 %buf: tensor<*xf32>, %shape: tensor<?xi32>) {
176 // expected-error @+1 {{cannot use shape operand with dynamic length to reshape to statically-ranked tensor type}}
177 tensor.reshape %buf(%shape) : (tensor<*xf32>, tensor<?xi32>) -> tensor<?xf32>
182 func.func @tensor.reshape_dst_shape_rank_mismatch(
183 %buf: tensor<*xf32>, %shape: tensor<1xi32>) {
184 // expected-error @+1 {{length of shape operand differs from the result's tensor rank}}
185 tensor.reshape %buf(%shape)
186 : (tensor<*xf32>, tensor<1xi32>) -> tensor<?x?xf32>
191 func.func @tensor.reshape_num_elements_mismatch(
192 %buf: tensor<1xf32>, %shape: tensor<1xi32>) {
193 // expected-error @+1 {{source and destination tensor should have the same number of elements}}
194 tensor.reshape %buf(%shape)
195 : (tensor<1xf32>, tensor<1xi32>) -> tensor<10xf32>
200 func.func @extract_slice_wrong_result_rank(%t: tensor<?xf32>, %idx : index) {
202 %0 = tensor.extract_slice %t[0][4][1] : tensor<?xf32> to tensor<?x?xf32>
208 func.func @extract_slice_wrong_result_rank(%t: tensor<?xf32>, %idx : index) {
210 %0 = tensor.extract_slice %t[0][4][1] : tensor<?xf32> to tensor<4xi8>
217 func.func @extract_slice_size_and_output_dim_mismatch_static_size(%t: tensor<16xf32>) {
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<16xf32> to tensor<6xf32>
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)}}
229 %0 = tensor.extract_slice %t[0][%c4][1] : tensor<?xf32> to tensor<4xi8>
235 func.func @extract_slice_wrong_static_type(%t: tensor<8x16x4xf32>, %idx : index) {
236 // expected-error @+1 {{expected type to be 'tensor<?x4x4xf32>' or a rank-reduced version. (size mismatch)}}
237 %0 = tensor.extract_slice %t[0, 0, 0][%idx, 4, 4][1, 1, 1]
238 : tensor<8x16x4xf32> to tensor<4x4x4xf32>
244 func.func @extract_slice_wrong_dynamic_type(%t: tensor<8x16x4xf32>, %idx : index) {
245 // expected-error @+1 {{expected type to be 'tensor<4x4x4xf32>' or a rank-reduced version. (size mismatch)}}
246 %0 = tensor.extract_slice %t[0, 2, 0][4, 4, 4][1, 1, 1]
247 : tensor<8x16x4xf32> to tensor<?x4x4xf32>
253 func.func @illegal_num_offsets(%arg0 : tensor<?x?x?xf32>, %arg1 : index, %arg2 : index) {
255 %0 = tensor.extract_slice %arg0[0, 0] [%arg1, %arg2] [1, 1] : tensor<?x?x?xf32> to tensor<?x?x?xf32>
261 func.func @insert_slice_wrong_result_rank(%t1: tensor<?xf32>, %t2: tensor<?x?xf32>, %idx : index) {
263 %0 = tensor.insert_slice %t2 into %t1[0][4][1] : tensor<?x?xf32> into tensor<?xf32>
270 func.func @insert_slice_wrong_result_rank(%t1: tensor<4xi8>, %t2: tensor<?xf32>, %idx : index) {
272 %0 = tensor.insert_slice %t1 into %t2[0][4][1] : tensor<4xi8> into tensor<?xf32>
279 func.func @insert_slice_wrong_static_type(%t1: tensor<4x4x4xf32>, %t2: tensor<8x16x4xf32>, %idx : index) {
280 // expected-error @+1 {{expected type to be 'tensor<?x4x4xf32>' or a rank-reduced version. (size mismatch)}}
281 %0 = tensor.insert_slice %t1 into %t2[0, 0, 0][%idx, 4, 4][1, 1, 1]
282 : tensor<4x4x4xf32> into tensor<8x16x4xf32>
289 func.func @insert_slice_wrong_dynamic_type(%t1: tensor<?x4x4xf32>, %t2: tensor<8x16x4xf32>, %idx : index) {
290 // expected-error @+1 {{expected type to be 'tensor<4x4x4xf32>' or a rank-reduced version. (size mismatch)}}
291 %0 = tensor.insert_slice %t1 into %t2[0, 2, 0][4, 4, 4][1, 1, 1]
292 : tensor<?x4x4xf32> into tensor<8x16x4xf32>
300 (%arg0: tensor<2x3x20xf32>) -> tensor<2x3x2x4x5xf32> {
302 %0 = tensor.expand_shape %arg0 [[0], [1], [2, 3, 4]] output_shape [2, 3, 2, 4, 5]
303 : tensor<2x3x20xf32> into tensor<2x3x2x4x5xf32>
304 return %0 : tensor<2x3x2x4x5xf32>
310 (%arg0: tensor<2x3x2x4x5xf32>) -> tensor<2x3x20xf32> {
312 %0 = tensor.collapse_shape %arg0 [[0], [1], [2, 3, 4]]
313 : tensor<2x3x2x4x5xf32> into tensor<2x3x20xf32>
314 return %0 : tensor<2x3x20xf32>
319 func.func @illegal_expanding_reshape_mixed_tensor(%arg0 : tensor<?x?xf32>, %sz0: index)
320 -> tensor<?x4x5xf32> {
322 %0 = tensor.expand_shape %arg0 [[0, 1], [2]] output_shape [%sz0, 4, 5]
323 : tensor<?x?xf32> into tensor<?x4x5xf32>
324 return %0 : tensor<?x4x5xf32>
329 func.func @illegal_expanding_reshape_mixed_tensor_2(%arg0 : tensor<?x?xf32>, %sz0: index)
330 -> tensor<?x4x5xf32> {
332 %0 = tensor.expand_shape %arg0 [[0], [1, 2]] output_shape [%sz0, 4, 5]
333 : tensor<?x?xf32> into tensor<?x4x5xf32>
334 return %0 : tensor<?x4x5xf32>
339 func.func @expand_shape_illegal_output_shape(%arg0: tensor<2xf32>) {
341 %0 = tensor.expand_shape %arg0 [[0, 1, 2]] output_shape [1, 2] : tensor<2xf32> into tensor<1x1x2xf32>
348 func.func @illegal_collapsing_reshape_mixed_tensor(%arg0 : tensor<?x4x5xf32>) -> tensor<?x?xf32> {
350 %0 = tensor.collapse_shape %arg0 [[0, 1], [2]]
351 : tensor<?x4x5xf32> into tensor<?x?xf32>
352 return %0 : tensor<?x?xf32>
357 func.func @illegal_collapsing_reshape_mixed_tensor_2(%arg0 : tensor<?x4x5xf32>)
358 -> tensor<?x?xf32> {
360 %0 = tensor.collapse_shape %arg0 [[0], [1, 2]]
361 : tensor<?x4x5xf32> into tensor<?x?xf32>
362 return %0 : tensor<?x?xf32>
368 // expected-error@+1 {{'tensor.rank' op operand #0 must be tensor of any type values}}
369 "tensor.rank"(%0): (f32)->index
375 func.func @illegal_num_offsets(%arg0 : tensor<?x?xf32>, %arg1 : tensor<?x?x?xf32>,
378 %0 = tensor.insert_slice %arg0 into %arg1[0, 0] [%arg2, %arg3] [1, 1] : tensor<?x?xf32> into tensor<?x?x?xf32>
385 func.func @pad_result_type(%arg0: tensor<?x2x3x4xi32>, %arg1: index, %arg2: i32) -> tensor<?x?x?x8xf32> {
386 // expected-error @+1 {{specified type 'tensor<?x?x?x8xf32>' does not match the inferred type 'tensor<?x?x?x9xi32>}}
387 %0 = tensor.pad %arg0 low[1, %arg1, 2, 2] high[1, 2, %arg1, 3] {
389 tensor.yield %arg2 : i32
390 } : tensor<?x2x3x4xi32> to tensor<?x?x?x8xf32>
391 return %0 : tensor<?x?x?x8xf32>
396 func.func @pad_number_of_block_args(%arg0: tensor<?x4xi32>, %arg1: i32) -> tensor<?x9xi32> {
398 %0 = tensor.pad %arg0 low[1, 2] high[2, 3] {
400 tensor.yield %arg1 : i32
401 } : tensor<?x4xi32> to tensor<?x9xi32>
402 return %0 : tensor<?x9xi32>
407 func.func @pad_block_args(%arg0: tensor<?x4xi32>, %arg1: i32) -> tensor<?x9xi32> {
409 %0 = tensor.pad %arg0 low[1, 2] high[2, 3] {
411 tensor.yield %arg1 : i32
412 } : tensor<?x4xi32> to tensor<?x9xi32>
413 return %0 : tensor<?x9xi32>
418 func.func @pad_yield_type(%arg0: tensor<?x4xi32>, %arg1: i8) -> tensor<?x9xi32> {
420 %0 = tensor.pad %arg0 low[1, 2] high[2, 3] {
422 tensor.yield %arg1 : i8
423 } : tensor<?x4xi32> to tensor<?x9xi32>
424 return %0 : tensor<?x9xi32>
431 tensor.splat %v : memref<8xf32>
439 %w = tensor.splat %v : tensor<8xvector<8xf32>>
447 %w = tensor.splat %v[%m] : tensor<?x8x?xf32>
454 %source : tensor<4x5x6xf32>, %indices: tensor<1x2x3xindex>) {
456 %out = tensor.gather %source[%indices] gather_dims([]):
457 (tensor<4x5x6xf32>, tensor<1x2x3xindex>) -> tensor<1x2xf32>
464 %source : tensor<4x5x6xf32>, %indices: tensor<1x2x3xindex>) {
466 %out = tensor.gather %source[%indices] gather_dims([0, 1, 2, 3]):
467 (tensor<4x5x6xf32>, tensor<1x2x3xindex>) -> tensor<1x2xf32>
474 %source: tensor<4x5x6xf32>, %indices: tensor<index>) {
476 %out = tensor.gather %source[%indices] gather_dims([0, 1, 2]):
477 (tensor<4x5x6xf32>, tensor<index>) -> tensor<1x2xf32>
483 %source: tensor<4x5x6xf32>, %indices: tensor<1x2x2xindex>) {
485 %out = tensor.gather %source[%indices] gather_dims([0, 1, 2]):
486 (tensor<4x5x6xf32>, tensor<1x2x2xindex>) -> tensor<1x2xf32>
492 %source : tensor<4x5x6xf32>, %indices: tensor<1x2x1xindex>) {
494 %out = tensor.gather %source[%indices] gather_dims([-1]):
495 (tensor<4x5x6xf32>, tensor<1x2x1xindex>) -> tensor<1x2x1xf32>
502 %source : tensor<4x5x6xf32>, %indices: tensor<1x2x1xindex>) {
504 %out = tensor.gather %source[%indices] gather_dims([42]):
505 (tensor<4x5x6xf32>, tensor<1x2x1xindex>) -> tensor<1x2x1xf32>
512 %source : tensor<4x5x6xf32>, %indices: tensor<1x2x2xindex>) {
514 %out = tensor.gather %source[%indices] gather_dims([1, 0]):
515 (tensor<4x5x6xf32>, tensor<1x2x2xindex>) -> tensor<1x2x1x1xf32>
522 %source : tensor<4x5x6xf32>, %indices: tensor<1x2x2xindex>) {
523 // expected-error@+1 {{result type mismatch: expected 'tensor<1x2x1x5x1xf32>' or its rank-reduced variant 'tensor<1x2x5xf32>' (got: 'tensor<1x2x1xf32>')}}
524 %out = tensor.gather %source[%indices] gather_dims([0, 2]):
525 (tensor<4x5x6xf32>, tensor<1x2x2xindex>) -> tensor<1x2x1xf32>
532 %source : tensor<f32>,
533 %dest : tensor<4x5x6xf32>, %indices: tensor<1x2x3xindex>) {
535 %out = tensor.scatter %source into %dest[%indices] scatter_dims([]) unique:
536 (tensor<f32>, tensor<4x5x6xf32>, tensor<1x2x3xindex>) -> tensor<1x2xf32>
543 %source : tensor<f32>,
544 %dest : tensor<4x5x6xf32>, %indices: tensor<1x2x3xindex>) {
546 %out = tensor.scatter %source into %dest[%indices] scatter_dims([0, 1, 2, 3]) unique:
547 (tensor<f32>, tensor<4x5x6xf32>, tensor<1x2x3xindex>) -> tensor<1x2xf32>
554 %source : tensor<f32>,
555 %dest : tensor<4x5x6xf32>, %indices: tensor<index>) {
557 %out = tensor.scatter %source into %dest[%indices] scatter_dims([0, 1, 2]) unique:
558 (tensor<f32>, tensor<4x5x6xf32>, tensor<index>) -> tensor<1x2xf32>
565 %source : tensor<f32>,
566 %dest : tensor<4x5x6xf32>, %indices: tensor<1x2x2xindex>) {
568 %out = tensor.scatter %source into %dest[%indices] scatter_dims([0, 1, 2]) unique:
569 (tensor<f32>, tensor<4x5x6xf32>, tensor<1x2x2xindex>) -> tensor<1x2xf32>
576 %source : tensor<f32>,
577 %dest : tensor<4x5x6xf32>, %indices: tensor<1x2x1xindex>) {
579 %out = tensor.scatter %source into %dest[%indices] scatter_dims([-1]) unique:
580 (tensor<f32>, tensor<4x5x6xf32>, tensor<1x2x1xindex>) -> tensor<1x2x1xf32>
587 %source : tensor<f32>,
588 %dest : tensor<4x5x6xf32>, %indices: tensor<1x2x1xindex>) {
590 %out = tensor.scatter %source into %dest[%indices] scatter_dims([42]) unique:
591 (tensor<f32>, tensor<4x5x6xf32>, tensor<1x2x1xindex>) -> tensor<1x2x1xf32>
598 %source : tensor<f32>,
599 %dest : tensor<4x5x6xf32>, %indices: tensor<1x2x2xindex>) {
601 %out = tensor.scatter %source into %dest[%indices] scatter_dims([1, 0]) unique:
602 (tensor<f32>, tensor<4x5x6xf32>, tensor<1x2x2xindex>) -> tensor<1x2x1x1xf32>
609 %source : tensor<f32>,
610 %dest : tensor<4x5x6xf32>, %indices: tensor<1x2x2xindex>) {
612 %out = tensor.scatter %source into %dest[%indices] scatter_dims([0, 2]):
613 (tensor<f32>, tensor<4x5x6xf32>, tensor<1x2x2xindex>) -> tensor<1x2x1xf32>
620 %source : tensor<f32>,
621 %dest : tensor<4x5x6xf32>, %indices: tensor<1x2x2xindex>) {
622 // expected-error@+1 {{source type mismatch: expected 'tensor<1x2x1x5x1xf32>' or its rank-reduced variant 'tensor<1x2x5xf32>' (got: 'tensor<f32>')}}
623 %out = tensor.scatter %source into %dest[%indices] scatter_dims([0, 2]) unique:
624 (tensor<f32>, tensor<4x5x6xf32>, tensor<1x2x2xindex>) -> tensor<1x2x1xf32>
632 %out = tensor.empty(%sz) : tensor<2x?x?x5xf32>
638 func.func @pack_invalid_no_padding_no_full_tiles(%input: tensor<256x128xf32>, %output: tensor<8x8x16x33xf32>) -> tensor<8x8x16x33xf32> {
640 %0 = tensor.pack %input inner_dims_pos = [1, 0] inner_tiles = [16, 33] into %output : tensor<256x128xf32> -> tensor<8x8x16x33xf32>
641 return %0 : tensor<8x8x16x33xf32>
646 func.func @pack_invalid_no_padding_no_full_tiles_dyn_tiles(%input: tensor<256x128xf32>, %output: tensor<10x8x?x?xf32>, %tile_size_0: index, %tile_size_1: index) -> tensor<10x8x?x?xf32> {
648 %0 = tensor.pack %input inner_dims_pos = [1, 0] inner_tiles = [%tile_size_0, %tile_size_1] into %output : tensor<256x128xf32> -> tensor<10x8x?x?xf32>
649 return %0 : tensor<10x8x?x?xf32>
654 func.func @pack_invalid_no_padding_no_full_tiles_dyn_tiles_outperm(%input: tensor<256x128xf32>, %output: tensor<8x10x?x?xf32>, %tile_size_0: index, %tile_size_1: index) -> tensor<8x10x?x?xf32> {
656 %0 = tensor.pack %input outer_dims_perm = [1, 0] inner_dims_pos = [1, 0] inner_tiles = [%tile_size_0, %tile_size_1] into %output : tensor<256x128xf32> -> tensor<8x10x?x?xf32>
657 return %0 : tensor<8x10x?x?xf32>
662 func.func @pad_and_pack_invalid_type(%input: tensor<13x15xf32>, %output: tensor<2x8x8x2xf32>, %pad: i32) -> tensor<2x8x8x2xf32> {
664 %0 = tensor.pack %input padding_value(%pad: i32) inner_dims_pos = [0, 1] inner_tiles = [8, 2] into %output : tensor<13x15xf32> -> tensor<2x8x8x2xf32>
665 return %0 : tensor<2x8x8x2xf32>
670 func.func @pack_invalid_inner_dims_pos_vector(%input: tensor<256x128xf32>, %output: tensor<8x8x32x16xf32>) -> tensor<8x8x32x16xf32> {
672 %0 = tensor.pack %input inner_dims_pos = [2, 0] inner_tiles = [2, 2] into %output : tensor<256x128xf32> -> tensor<8x8x32x16xf32>
673 return %0 : tensor<8x8x32x16xf32>
678 func.func @pack_invalid_duplicate_element_in_inner_dims(%input: tensor<256x128xf32>, %output: tensor<8x8x32x16xf32>) -> tensor<8x8x32x16xf32> {
680 %0 = tensor.pack %input inner_dims_pos = [1, 1] inner_tiles = [2, 2] into %output : tensor<256x128xf32> -> tensor<8x8x32x16xf32>
681 return %0 : tensor<8x8x32x16xf32>
686 func.func @pack_invalid_duplicate_element_in_outer_perm(%input: tensor<256x128xf32>, %output: tensor<8x8x32x16xf32>) -> tensor<8x8x32x16xf32> {
688 %0 = tensor.pack %input outer_dims_perm = [1, 1] inner_dims_pos = [0, 1] inner_tiles = [2, 2] into %output : tensor<256x128xf32> -> tensor<8x8x32x16xf32>
689 return %0 : tensor<8x8x32x16xf32>
694 func.func @pack_invalid_output_rank(%input: tensor<256x128xf32>, %output: tensor<64x32x16xf32>) -> tensor<64x32x16xf32> {
696 %0 = tensor.pack %input inner_dims_pos = [0, 1] inner_tiles = [32, 16] into %output : tensor<256x128xf32> -> tensor<64x32x16xf32>
697 return %0 : tensor<64x32x16xf32>
702 func.func @unpack_invalid_output_rank(%input: tensor<256x128xf32>, %output: tensor<64x32x16xf32>) -> tensor<256x128xf32> {
704 %0 = tensor.unpack %output inner_dims_pos = [0, 1] inner_tiles = [32, 16] into %input : tensor<64x32x16xf32> -> tensor<256x128xf32>
705 return %0 : tensor<256x128xf32>
710 func.func @unpack_invalid_out_of_bound_outer_perm(%input: tensor<256x128xf32>, %output: tensor<8x8x32x16xf32>) -> tensor<8x8x32x16xf32> {
712 %0 = tensor.unpack %output outer_dims_perm = [2, 1] inner_dims_pos = [0, 1] inner_tiles = [2, 2] into %input : tensor<8x8x32x16xf32> -> tensor<256x128xf32>
713 return %0 : tensor<256x128xf32>
718 func.func @pack_invalid_outer_dims_perm(%source: tensor<128x256xf32>, %dest: tensor<16x4x32x16xf32>) -> tensor<16x4x32x16xf32> {
720 %0 = tensor.pack %source outer_dims_perm = [0] inner_dims_pos = [0, 1] inner_tiles = [32, 16] into %dest : tensor<128x256xf32> -> tensor<16x4x32x16xf32>
721 return %0 : tensor<16x4x32x16xf32>
726 func.func @unpack_invalid_outer_dims_perm(%source: tensor<128x256xf32>, %dest: tensor<16x4x32x16xf32>) -> tensor<128x256xf32> {
728 %0 = tensor.unpack %dest outer_dims_perm = [1] inner_dims_pos = [0, 1] inner_tiles = [32, 16] into %source : tensor<16x4x32x16xf32> -> tensor<128x256xf32>
729 return %0 : tensor<128x256xf32>
734 func.func @pack_invalid(%input: tensor<256x128xf32>, %output: tensor<8x8x32x16xf32>) -> tensor<8x8x32x16xf32> {
735 // expected-error@+1 {{the shape of output is not large enough to hold the packed data. Expected at least 'tensor<8x8x16x32xf32>', got 'tensor<8x8x32x16xf32>'}}
736 %0 = tensor.pack %input inner_dims_pos = [1, 0] inner_tiles = [16, 32] into %output : tensor<256x128xf32> -> tensor<8x8x32x16xf32>
737 return %0 : tensor<8x8x32x16xf32>
742 func.func @unpack_invalid(%output: tensor<256x128xf32>, %input: tensor<8x8x32x16xf32>) -> tensor<256x128xf32> {
743 // expected-error@+1 {{the shape of output is not large enough to hold the packed data. Expected at least 'tensor<8x32x4x32xf32>', got 'tensor<8x8x32x16xf32>'}}
744 %0 = tensor.unpack %input inner_dims_pos = [1, 0] inner_tiles = [4, 32] into %output : tensor<8x8x32x16xf32> -> tensor<256x128xf32>
745 return %0 : tensor<256x128xf32>
750 func.func @pack_invalid(%input: tensor<256x128xf32>, %output: tensor<8x8x32x16xf32>) -> tensor<8x8x32x16xf32> {
752 %0 = tensor.pack %input inner_dims_pos = [1, 0] inner_tiles = [0, 2] into %output : tensor<256x128xf32> -> tensor<8x8x32x16xf32>
753 return %0 : tensor<8x8x32x16xf32>
758 %input : tensor<?x?xf32>, %output : tensor<?x?x8x8xf32>) -> tensor<?x?x8x8xf32> {
760 %0 = tensor.pack %input inner_dims_pos = [0, 1] inner_tiles = [8, 4] into %output : tensor<?x?xf32> -> tensor<?x?x8x8xf32>
761 return %0 : tensor<?x?x8x8xf32>
767 %input : tensor<?x?xf32>, %output : tensor<?x?x8x8xf32>) -> tensor<?x?x8x8xf32> {
770 %0 = tensor.pack %input inner_dims_pos = [0, 1] inner_tiles = [8, %c8] into %output : tensor<?x?xf32> -> tensor<?x?x8x8xf32>
771 return %0 : tensor<?x?x8x8xf32>
777 %input : tensor<?x?xf32>, %output : tensor<?x?x8x?xf32>) -> tensor<?x?x8x?xf32> {
779 %0 = tensor.pack %input inner_dims_pos = [0, 1] inner_tiles = [8, 8] into %output : tensor<?x?xf32> -> tensor<?x?x8x?xf32>
780 return %0 : tensor<?x?x8x?xf32>
786 %input : tensor<?x?x8x8xf32>, %output : tensor<?x?xf32>) -> tensor<?x?xf32> {
788 %0 = tensor.unpack %input inner_dims_pos = [0, 1] inner_tiles = [8, 4] into %output : tensor<?x?x8x8xf32> -> tensor<?x?xf32>
789 return %0 : tensor<?x?xf32>
795 %input : tensor<?x?x8x4xf32>, %output : tensor<?x?xf32>) -> tensor<?x?xf32> {
798 %0 = tensor.unpack %input inner_dims_pos = [0, 1] inner_tiles = [%c8, 4] into %output : tensor<?x?x8x4xf32> -> tensor<?x?xf32>
799 return %0 : tensor<?x?xf32>
805 %input : tensor<?x?x?x4xf32>, %output : tensor<?x?xf32>) -> tensor<?x?xf32> {
807 %0 = tensor.unpack %input inner_dims_pos = [0, 1] inner_tiles = [8, 4] into %output : tensor<?x?x?x4xf32> -> tensor<?x?xf32>
808 return %0 : tensor<?x?xf32>
813 func.func @bitcast_index_0(%arg0 : tensor<?xi64>) -> tensor<?xindex> {
814 // expected-error @+1 {{'tensor.bitcast' op result #0 must be tensor of signless integer or unsigned integer or signed integer or floating-point values, but got 'tensor<?xindex>'}}
815 %0 = tensor.bitcast %arg0 : tensor<?xi64> to tensor<?xindex>
816 return %0 : tensor<?xindex>
821 func.func @bitcast_index_1(%arg0 : tensor<?xindex>) -> tensor<?xi64> {
822 // expected-error @+1 {{'tensor.bitcast' op operand #0 must be tensor of signless integer or unsigned integer or signed integer or floating-point values, but got 'tensor<?xindex>'}}
823 %0 = tensor.bitcast %arg0 : tensor<?xindex> to tensor<?xi64>
824 return %0 : tensor<?xi64>