-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-101] Support float16 in LeakyReLU operator #10169
Conversation
0fcaa7d
to
512feea
Compare
@@ -217,7 +237,7 @@ class LeakyReLUOp : public Operator { | |||
}; // class LeakyReLUOp | |||
|
|||
template<typename xpu> | |||
Operator* CreateOp(LeakyReLUParam type); | |||
Operator* CreateOp(LeakyReLUParam type, int dtype); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not familiar with the cpp code, but is there no typedef for dtype - int is kind of arbitrary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The types are represented by integers, please see leaky_relu.cc:43 for how this function is being called. Also you can refer to https://github.com/dmlc/mshadow/blob/b3771de20ed36f90ba7b8436ae4b79ea298a687a/mshadow/base.h#L288 for more info about how each integer map to a type. This change is written in a similar way as #2322 #3011 #10078 #10125 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for the explanation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My pleasure! 😄
fb0c6c2
to
5390b43
Compare
5390b43
to
d44a588
Compare
* support for any datatype in leaky ReLU * test for LeakyReLU operators * make lint * clean up unnecessary prints * fix for amalgamation build failure * add InferType for Leaky ReLU and slight modification to the tests
* support for any datatype in leaky ReLU * test for LeakyReLU operators * make lint * clean up unnecessary prints * fix for amalgamation build failure * add InferType for Leaky ReLU and slight modification to the tests
* support for any datatype in leaky ReLU * test for LeakyReLU operators * make lint * clean up unnecessary prints * fix for amalgamation build failure * add InferType for Leaky ReLU and slight modification to the tests
* support for any datatype in leaky ReLU * test for LeakyReLU operators * make lint * clean up unnecessary prints * fix for amalgamation build failure * add InferType for Leaky ReLU and slight modification to the tests
Description
Add support for any datatype for Leaky ReLU operator, mentioned in issue #2302.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments
The test for rrelu is harder to write as rrelu contains random components in forward pass, will figure out a way to write a test for it later.