From cf629e35ed9525fa3abd54f5222b2afe7454924a Mon Sep 17 00:00:00 2001 From: zhupengyang Date: Wed, 30 Oct 2019 20:14:11 +0800 Subject: [PATCH] [XPU] update elemetwise_add, conv and mul ops (#2293) test=develop --- lite/kernels/xpu/bridges/conv_op.cc | 2 +- lite/kernels/xpu/bridges/elementwise_ops.cc | 2 +- lite/kernels/xpu/bridges/mul_op.cc | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lite/kernels/xpu/bridges/conv_op.cc b/lite/kernels/xpu/bridges/conv_op.cc index c7c2f0ca5f..2c758cf950 100644 --- a/lite/kernels/xpu/bridges/conv_op.cc +++ b/lite/kernels/xpu/bridges/conv_op.cc @@ -136,7 +136,7 @@ node_map_type ConvConverter(const std::shared_ptr op, std::shared_ptr add_node = nullptr; if (is_channel_bias) { add_node = std::make_shared( - graph_ctx->builder->CreateBiasAdd(*conv_node, *bias_node, 1)); + graph_ctx->builder->CreateBiasAdd(*conv_node, 1, *bias_node)); } else { add_node = std::make_shared( graph_ctx->builder->CreateBinaryOp("add", *conv_node, *bias_node)); diff --git a/lite/kernels/xpu/bridges/elementwise_ops.cc b/lite/kernels/xpu/bridges/elementwise_ops.cc index 70906b5ec9..b9fe7db14d 100644 --- a/lite/kernels/xpu/bridges/elementwise_ops.cc +++ b/lite/kernels/xpu/bridges/elementwise_ops.cc @@ -69,7 +69,7 @@ node_map_type ElementwiseConverter(const std::shared_ptr op, std::shared_ptr elementwise_node = nullptr; if (y_dims.size() == 1) { elementwise_node = std::make_shared( - graph_ctx->builder->CreateBiasAdd(*x_node, *y_node, axis)); + graph_ctx->builder->CreateBiasAdd(*x_node, axis, *y_node)); } else if (x_dims.size() == y_dims.size()) { elementwise_node = std::make_shared( graph_ctx->builder->CreateBinaryOp("add", *x_node, *y_node)); diff --git a/lite/kernels/xpu/bridges/mul_op.cc b/lite/kernels/xpu/bridges/mul_op.cc index edf44f78bb..549abd3b13 100644 --- a/lite/kernels/xpu/bridges/mul_op.cc +++ b/lite/kernels/xpu/bridges/mul_op.cc @@ -78,8 +78,11 @@ node_map_type MulConverter(const std::shared_ptr op, // create mul node and set params from op std::shared_ptr mul_node = nullptr; - mul_node = std::make_shared(graph_ctx->builder->CreateDense( - *x_node, *y_const_node, static_cast(y_dims[1]))); + mul_node = std::make_shared( + graph_ctx->builder->CreateDense(*x_node, + static_cast(y_dims[1]), + ::xtcl::NullValue<::xtcl::DataType>(), + *y_const_node)); graph_ctx->builder->SetLayer(unique_op_type); // output converted nodes -- GitLab