Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Dialect/Linalg/roundtrip.mlir
Show First 20 Lines • Show All 827 Lines • ▼ Show 20 Lines | |||||
// ----- | // ----- | ||||
func @fill_tensor(%arg0 : index, %arg1 : index, %arg2 : f32) -> tensor<?x?xf32> { | func @fill_tensor(%arg0 : index, %arg1 : index, %arg2 : f32) -> tensor<?x?xf32> { | ||||
%0 = linalg.init_tensor [%arg0, %arg1] : tensor<?x?xf32> | %0 = linalg.init_tensor [%arg0, %arg1] : tensor<?x?xf32> | ||||
%1 = linalg.fill(%0, %arg2) : tensor<?x?xf32>, f32 -> tensor<?x?xf32> | %1 = linalg.fill(%0, %arg2) : tensor<?x?xf32>, f32 -> tensor<?x?xf32> | ||||
return %1 : tensor<?x?xf32> | return %1 : tensor<?x?xf32> | ||||
} | } | ||||
// CHECK: %{{.+}} = linalg.fill(%{{.+}}, %{{.+}}) : tensor<?x?xf32>, f32 -> tensor<?x?xf32> | // CHECK: %{{.+}} = linalg.fill(%{{.+}}, %{{.+}}) : tensor<?x?xf32>, f32 -> tensor<?x?xf32> | ||||
// ----- | |||||
// TODO: this op should disappear once pad_tensors is available and connected. | |||||
// CHECK-LABEL: func @simple_pad | |||||
func @simple_pad(%0: tensor<?x4x?xf32>, %pad: f32) { | |||||
// CHECK: linalg.simple_pad %{{.+}} pad %{{.+}}: tensor<?x4x?xf32> to tensor<8x4x8xf32> | |||||
%1 = linalg.simple_pad %0 pad %pad: tensor<?x4x?xf32> to tensor<8x4x8xf32> pad f32 | |||||
return | |||||
} |