You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/10/20 17:21:49 UTC
[GitHub] reminisce commented on a change in pull request #8361: Simplified unary/binary math operators
reminisce commented on a change in pull request #8361: Simplified unary/binary math operators
URL: https://github.com/apache/incubator-mxnet/pull/8361#discussion_r146020700
##########
File path: src/operator/mshadow_op.h
##########
@@ -1087,10 +593,10 @@ struct smooth_l1_gradient {
template<typename DType>
MSHADOW_XINLINE static DType Map(DType a, DType b) {
b *= b;
- if (a > DType(1.0f) / b) {
- return DType(1.0f);
- } else if (a < DType(-1.0f) / b) {
- return DType(-1.0f);
+ if (a > 1.0f / b) {
+ return 1.0f;
Review comment:
`return DType(1)` consistent with the other condition branch?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services