Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Conversion/ShapeToStandard/shape-to-standard.mlir
Show First 20 Lines • Show All 587 Lines • ▼ Show 20 Lines | |||||
// CHECK: } : tensor<?xindex> | // CHECK: } : tensor<?xindex> | ||||
// CHECK: return | // CHECK: return | ||||
// CHECK: } | // CHECK: } | ||||
%0 = shape.broadcast %a, %b, %c | %0 = shape.broadcast %a, %b, %c | ||||
: tensor<2xindex>, tensor<3xindex>, tensor<2xindex> -> tensor<?xindex> | : tensor<2xindex>, tensor<3xindex>, tensor<2xindex> -> tensor<?xindex> | ||||
return | return | ||||
} | } | ||||
// ---- | // ----- | ||||
// CHECK-LABEL: @broadcast_to_known_rank | // CHECK-LABEL: @broadcast_to_known_rank | ||||
func @broadcast_to_known_rank(%a : tensor<1xindex>, %b : tensor<3xindex>) | func @broadcast_to_known_rank(%a : tensor<1xindex>, %b : tensor<3xindex>) | ||||
-> tensor<3xindex> { | -> tensor<3xindex> { | ||||
// CHECK: %[[RES:.*]] = tensor.cast %{{.*}} : tensor<?xindex> to tensor<3xindex> | // CHECK: %[[RES:.*]] = tensor.cast %{{.*}} : tensor<?xindex> to tensor<3xindex> | ||||
// CHECK: return %[[RES]] : tensor<3xindex> | // CHECK: return %[[RES]] : tensor<3xindex> | ||||
%0 = shape.broadcast %a, %b : tensor<1xindex>, tensor<3xindex> -> tensor<3xindex> | %0 = shape.broadcast %a, %b : tensor<1xindex>, tensor<3xindex> -> tensor<3xindex> | ||||
return %0 : tensor<3xindex> | return %0 : tensor<3xindex> | ||||
Show All 21 Lines |