piiswrong commented on a change in pull request #9662: Gluon PReLU, ELU, SELU, 
Swish
URL: https://github.com/apache/incubator-mxnet/pull/9662#discussion_r166086739
 
 

 ##########
 File path: src/operator/leaky_relu-inl.h
 ##########
 @@ -225,7 +242,11 @@ class LeakyReLUProp : public OperatorProperty {
     const TShape &dshape = in_shape->at(leakyrelu::kData);
     if (dshape.ndim() == 0) return false;
     if (param_.act_type == leakyrelu::kPReLU) {
-      in_shape->at(leakyrelu::kGamma) = TShape(Shape1(dshape[1]));
+      const TShape &gshape = in_shape->at(leakyrelu::kGamma);
+      if (gshape.Size() != 1)
 
 Review comment:
   gshape could be empty, in which case Size is undefined.
   Also if gshape.Size is 1, it could be (1,1), which is invalid

----------------------------------------------------------------
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

Reply via email to