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 18:16:00 UTC
[GitHub] piiswrong commented on a change in pull request #8361: Simplified unary/binary math operators
piiswrong commented on a change in pull request #8361: Simplified unary/binary math operators
URL: https://github.com/apache/incubator-mxnet/pull/8361#discussion_r146033251
##########
File path: src/operator/mshadow_op.h
##########
@@ -1068,12 +574,12 @@ struct smooth_l1_loss {
template<typename DType>
MSHADOW_XINLINE static DType Map(DType a, DType b) {
b *= b;
- if (a > DType(1.0f) / b) {
- return a - DType(0.5f) / b;
- } else if (a < DType(-1.0f) / b) {
- return -a - DType(0.5f) / b;
+ if (a > 1.0f / b) {
Review comment:
I think the compiler is smart enough to optimize this out
----------------------------------------------------------------
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