piiswrong commented on a change in pull request #7782: Scala fix
URL: https://github.com/apache/incubator-mxnet/pull/7782#discussion_r137603895
##########
File path: src/operator/spatial_transformer.cc
##########
@@ -28,7 +28,7 @@
namespace mshadow {
template<typename DType>
bool between(DType value, int lowerBound, int upperBound) {
- return (value >= lowerBound && value <= upperBound);
+ return (static_cast<int>(value) >= lowerBound && static_cast<int>(value) <=
upperBound);
Review comment:
I think the proper fix is to change DType to just int if it's never used for
float.
Otherwise your fix changes behavior. Suppose value = 5.5 and upperbound = 5
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services