phi_pass.mlir 769 字节
Newer Older
1
// RUN: infrtopt -phi-op-convert=valid-targets=CPU-FP32-NCHW -infrt-op-fuse %s
王明冬 已提交
2

3
// CHECK-LABEL: @ops
4
func @ops(%a:!infrt.lod_tensor<?xf32,0>, %b:!infrt.lod_tensor<?xf32,0>) {
5 6
  %g = "pd.elementwise_add"(%a, %b) {axis=1:si32} : (!infrt.lod_tensor<?xf32,0>, !infrt.lod_tensor<?xf32>) -> tensor<?xf32>
  %h = "pd.abs"(%g):(tensor<?xf32>) -> tensor<?xf32>
7
  infrt.return %h:tensor<?xf32>
8
}
王明冬 已提交
9 10 11 12 13

// CHECK-LABEL: @op_execute
func @op_execute(%a:!infrt.lod_tensor<?xf32,0>, %b:!infrt.lod_tensor<?xf32,0>, %c:!infrt.lod_tensor<?xf32,0>)  -> !infrt.lod_tensor<?xf32,0> {
  %g = "pd.elementwise_add"(%a, %b) {axis=1:si32} : (!infrt.lod_tensor<?xf32,0>, !infrt.lod_tensor<?xf32>) -> tensor<?xf32>
  %h = "pd.abs"(%g):(tensor<?xf32>) -> tensor<?xf32>
14
  infrt.return %h:tensor<?xf32>
王明冬 已提交
15
}