// CHECK-LABEL: @predict func @predict(%input:!infrt.tensor, %map: !infrt.tensor_map) -> (!infrt.tensor) { %w = dt.get_param(%map, "create_parameter_0.w_0") -> !infrt.tensor %bias = dt.get_param(%map, "create_parameter_1.w_0") -> !infrt.tensor %out = dt.create_uninit_tensor.f32 [3, 3] -> !infrt.tensor // fc "external.matmul"(%input, %w, %out) {}: (!infrt.tensor, !infrt.tensor, !infrt.tensor) -> () "external.elementwise_add"(%out, %bias, %out) {axis = -1}: (!infrt.tensor, !infrt.tensor, !infrt.tensor) -> () "external.sigmoid"(%out, %out) {}: (!infrt.tensor, !infrt.tensor) -> () //dt.print_tensor (%out : !infrt.tensor) infrt.return %out : !infrt.tensor } // CHECK-LABEL: @main func @main() { %input = dt.create_uninit_tensor.f32 [3, 3] -> !infrt.tensor dt.fill_tensor_with_constant.f32 (%input : !infrt.tensor) {value=1.0:f32} %path = infrt.get_string("/infrt/build/paddle/paddle_1.8_fc_model") // CHECK-LABEL: loading params %map = dt.load_params(%path) %out = infrt.call @predict(%input, %map): (!infrt.tensor, !infrt.tensor_map) -> (!infrt.tensor) dt.print_tensor (%out : !infrt.tensor) infrt.return }