Lines Matching refs:tensor

3 func.func @dim(%arg : tensor<1x?xf32>) {
5 tensor.dim %arg, %c2 : tensor<1x?xf32> // expected-error {{'tensor.dim' op index is out of range}}
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 incom…
13 %0 = tensor.cast %arg0 : tensor<1xf32> to tensor<2xf32>
19 func.func @extract_too_many_indices(%arg0: tensor<?xf32>) {
21 %0 = tensor.extract %arg0[] : tensor<?xf32>
27 func.func @insert_too_many_indices(%arg0: f32, %arg1: tensor<?xf32>) {
29 %0 = tensor.insert %arg0 into %arg1[] : tensor<?xf32>
35 func.func @tensor.from_elements_wrong_result_type() {
36 …expected-error@+2 {{'result' must be statically shaped tensor of any type values, but got 'tensor<…
38 %0 = tensor.from_elements %c0 : tensor<*xi32>
44 func.func @tensor.from_elements_wrong_elements_count() {
47 %0 = tensor.from_elements %c0 : tensor<2xindex>
53 func.func @tensor.generate(%m : index)
54 -> tensor<?x3x?xf32> {
56 %tnsr = tensor.generate %m {
59 tensor.yield %elem : f32
60 } : tensor<?x3x?xf32>
61 return %tnsr : tensor<?x3x?xf32>
66 func.func @tensor.generate(%m : index, %n : index)
67 -> tensor<?x3x?xf32> {
69 %tnsr = tensor.generate %m, %n {
72 tensor.yield %elem : f32
73 } : tensor<?x3x?xf32>
74 return %tnsr : tensor<?x3x?xf32>
79 func.func @tensor.generate(%m : index, %n : index)
80 -> tensor<?x3x?xf32> {
82 %tnsr = tensor.generate %m, %n {
85 tensor.yield %elem : f32
86 } : tensor<?x3x?xf32>
87 return %tnsr : tensor<?x3x?xf32>
92 func.func @tensor.generate(%m : index, %n : index)
93 -> tensor<?x3x?xf32> {
95 %tnsr = tensor.generate %m, %n {
99 } : tensor<?x3x?xf32>
100 return %tnsr : tensor<?x3x?xf32>
105 func.func @tensor.generate(%m : index, %n : index)
106 -> tensor<?x3x?xf32> {
107 …// expected-error @+1 {{body must be terminated with a `yield` operation of the tensor element typ…
108 %tnsr = tensor.generate %m, %n {
111 tensor.yield %elem : i32
112 } : tensor<?x3x?xf32>
113 return %tnsr : tensor<?x3x?xf32>
117 func.func @tensor.reshape_element_type_mismatch(
118 %buf: tensor<*xf32>, %shape: tensor<1xi32>) {
119 // expected-error @+1 {{element types of source and destination tensor types should be the same}}
120 tensor.reshape %buf(%shape) : (tensor<*xf32>, tensor<1xi32>) -> tensor<?xi32>
125 func.func @tensor.reshape_dst_ranked_shape_unranked(
126 %buf: tensor<*xf32>, %shape: tensor<?xi32>) {
127 …or @+1 {{cannot use shape operand with dynamic length to reshape to statically-ranked tensor type}}
128 tensor.reshape %buf(%shape) : (tensor<*xf32>, tensor<?xi32>) -> tensor<?xf32>
133 func.func @tensor.reshape_dst_shape_rank_mismatch(
134 %buf: tensor<*xf32>, %shape: tensor<1xi32>) {
135 // expected-error @+1 {{length of shape operand differs from the result's tensor rank}}
136 tensor.reshape %buf(%shape)
137 : (tensor<*xf32>, tensor<1xi32>) -> tensor<?x?xf32>
142 func.func @tensor.reshape_num_elements_mismatch(
143 %buf: tensor<1xf32>, %shape: tensor<1xi32>) {
144 // expected-error @+1 {{source and destination tensor should have the same number of elements}}
145 tensor.reshape %buf(%shape)
146 : (tensor<1xf32>, tensor<1xi32>) -> tensor<10xf32>
151 func.func @extract_slice_wrong_result_rank(%t: tensor<?xf32>, %idx : index) {
153 %0 = tensor.extract_slice %t[0][4][1] : tensor<?xf32> to tensor<?x?xf32>
160 func.func @extract_slice_wrong_result_rank(%t: tensor<?xf32>, %idx : index) {
162 %0 = tensor.extract_slice %t[0][4][1] : tensor<?xf32> to tensor<4xi8>
169 func.func @extract_slice_wrong_static_type(%t: tensor<8x16x4xf32>, %idx : index) {
170 …// expected-error @+1 {{expected type to be 'tensor<?x4x4xf32>' or a rank-reduced version. (size m…
171 %0 = tensor.extract_slice %t[0, 0, 0][%idx, 4, 4][1, 1, 1]
172 : tensor<8x16x4xf32> to tensor<4x4x4xf32>
179 func.func @extract_slice_wrong_dynamic_type(%t: tensor<8x16x4xf32>, %idx : index) {
180 …// expected-error @+1 {{expected type to be 'tensor<4x4x4xf32>' or a rank-reduced version. (size m…
181 %0 = tensor.extract_slice %t[0, 2, 0][4, 4, 4][1, 1, 1]
182 : tensor<8x16x4xf32> to tensor<?x4x4xf32>
189 func.func @insert_slice_wrong_result_rank(%t1: tensor<?xf32>, %t2: tensor<?x?xf32>, %idx : index) {
191 %0 = tensor.insert_slice %t2 into %t1[0][4][1] : tensor<?x?xf32> into tensor<?xf32>
198 func.func @insert_slice_wrong_result_rank(%t1: tensor<4xi8>, %t2: tensor<?xf32>, %idx : index) {
200 %0 = tensor.insert_slice %t1 into %t2[0][4][1] : tensor<4xi8> into tensor<?xf32>
207 func.func @insert_slice_wrong_static_type(%t1: tensor<4x4x4xf32>, %t2: tensor<8x16x4xf32>, %idx : i…
208 …// expected-error @+1 {{expected type to be 'tensor<?x4x4xf32>' or a rank-reduced version. (size m…
209 %0 = tensor.insert_slice %t1 into %t2[0, 0, 0][%idx, 4, 4][1, 1, 1]
210 : tensor<4x4x4xf32> into tensor<8x16x4xf32>
217 func.func @insert_slice_wrong_dynamic_type(%t1: tensor<?x4x4xf32>, %t2: tensor<8x16x4xf32>, %idx : …
218 …// expected-error @+1 {{expected type to be 'tensor<4x4x4xf32>' or a rank-reduced version. (size m…
219 %0 = tensor.insert_slice %t1 into %t2[0, 2, 0][4, 4, 4][1, 1, 1]
220 : tensor<?x4x4xf32> into tensor<8x16x4xf32>
228 (%arg0: tensor<?x?x?xf32>) -> tensor<?x?x?x4x?xf32> {
230 %0 = tensor.expand_shape %arg0 [[0], [1], [2, 3, 4]]
231 : tensor<?x?x?xf32> into tensor<?x?x?x4x?xf32>
232 return %0 : tensor<?x?x?x4x?xf32>
239 (%arg0: tensor<2x3x20xf32>) -> tensor<2x3x2x4x5xf32> {
241 %0 = tensor.expand_shape %arg0 [[0], [1], [2, 3, 4]]
242 : tensor<2x3x20xf32> into tensor<2x3x2x4x5xf32>
243 return %0 : tensor<2x3x2x4x5xf32>
249 (%arg0: tensor<2x3x2x4x5xf32>) -> tensor<2x3x20xf32> {
251 %0 = tensor.collapse_shape %arg0 [[0], [1], [2, 3, 4]]
252 : tensor<2x3x2x4x5xf32> into tensor<2x3x20xf32>
253 return %0 : tensor<2x3x20xf32>
258 func.func @illegal_expanding_reshape_mixed_tensor(%arg0 : tensor<?x?xf32>)
259 -> tensor<?x4x5xf32> {
261 %0 = tensor.expand_shape %arg0 [[0, 1], [2]]
262 : tensor<?x?xf32> into tensor<?x4x5xf32>
263 return %0 : tensor<?x4x5xf32>
268 func.func @illegal_expanding_reshape_mixed_tensor_2(%arg0 : tensor<?x?xf32>)
269 -> tensor<?x4x5xf32> {
271 %0 = tensor.expand_shape %arg0 [[0], [1, 2]]
272 : tensor<?x?xf32> into tensor<?x4x5xf32>
273 return %0 : tensor<?x4x5xf32>
278 func.func @illegal_collapsing_reshape_mixed_tensor(%arg0 : tensor<?x4x5xf32>) -> tensor<?x?xf32> {
280 %0 = tensor.collapse_shape %arg0 [[0, 1], [2]]
281 : tensor<?x4x5xf32> into tensor<?x?xf32>
282 return %0 : tensor<?x?xf32>
287 func.func @illegal_collapsing_reshape_mixed_tensor_2(%arg0 : tensor<?x4x5xf32>)
288 -> tensor<?x?xf32> {
290 %0 = tensor.collapse_shape %arg0 [[0], [1, 2]]
291 : tensor<?x4x5xf32> into tensor<?x?xf32>
292 return %0 : tensor<?x?xf32>
298 // expected-error@+1 {{'tensor.rank' op operand #0 must be tensor of any type values}}
299 "tensor.rank"(%0): (f32)->index
305 func.func @illegal_num_offsets(%arg0 : tensor<?x?x?xf32>, %arg1 : index, %arg2 : index) {
307 …%0 = tensor.extract_slice %arg0[0, 0] [%arg1, %arg2] [1, 1] : tensor<?x?x?xf32> to tensor<?x?x?xf3…
313 func.func @illegal_num_offsets(%arg0 : tensor<?x?xf32>, %arg1 : tensor<?x?x?xf32>,
316 …%0 = tensor.insert_slice %arg0 into %arg1[0, 0] [%arg2, %arg3] [1, 1] : tensor<?x?xf32> into tenso…
323 func.func @pad_result_type(%arg0: tensor<?x2x3x4xi32>, %arg1: index, %arg2: i32) -> tensor<?x?x?x8x…
324 …// expected-error @+1 {{specified type 'tensor<?x?x?x8xf32>' does not match the inferred type 'ten…
325 %0 = tensor.pad %arg0 low[1, %arg1, 2, 2] high[1, 2, %arg1, 3] {
327 tensor.yield %arg2 : i32
328 } : tensor<?x2x3x4xi32> to tensor<?x?x?x8xf32>
329 return %0 : tensor<?x?x?x8xf32>
334 func.func @pad_number_of_block_args(%arg0: tensor<?x4xi32>, %arg1: i32) -> tensor<?x9xi32> {
336 %0 = tensor.pad %arg0 low[1, 2] high[2, 3] {
338 tensor.yield %arg1 : i32
339 } : tensor<?x4xi32> to tensor<?x9xi32>
340 return %0 : tensor<?x9xi32>
345 func.func @pad_block_args(%arg0: tensor<?x4xi32>, %arg1: i32) -> tensor<?x9xi32> {
347 %0 = tensor.pad %arg0 low[1, 2] high[2, 3] {
349 tensor.yield %arg1 : i32
350 } : tensor<?x4xi32> to tensor<?x9xi32>
351 return %0 : tensor<?x9xi32>
356 func.func @pad_yield_type(%arg0: tensor<?x4xi32>, %arg1: i8) -> tensor<?x9xi32> {
358 %0 = tensor.pad %arg0 low[1, 2] high[2, 3] {
360 tensor.yield %arg1 : i8
361 } : tensor<?x4xi32> to tensor<?x9xi32>
362 return %0 : tensor<?x9xi32>
369 tensor.splat %v : memref<8xf32>
377 %w = tensor.splat %v : tensor<8xvector<8xf32>>