eric-haibin-lin commented on a change in pull request #11012: [WIP] leaky relu speed URL: https://github.com/apache/incubator-mxnet/pull/11012#discussion_r191014378
########## File path: src/operator/leaky_relu-inl.h ########## @@ -115,11 +116,27 @@ class LeakyReLUOp : public Operator { case leakyrelu::kPReLU: { weight = in_data[leakyrelu::kGamma].get<xpu, 1, DType>(s); if (weight.shape_.Size() == 1) { - Assign(out, req[leakyrelu::kOut], - F<mshadow_op::xelu>(data, mshadow::expr::broadcast_scalar(weight, out.shape_))); + MXNET_ASSIGN_REQ_SWITCH(req[leakyrelu::kOut], Req, { + mxnet_op::Kernel<mxnet_op::op_with_req<op::mshadow_op::xelu, Req>, xpu>::Launch( + s, in_data[leakyrelu::kData].Size(), out_data[leakyrelu::kOut].dptr<DType>(), + in_data[leakyrelu::kData].dptr<DType>(), DType(weight[0])); Review comment: Cannot access gpu ptr outside kernel ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services