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 2018/11/10 18:33:12 UTC

[GitHub] gigasquid closed pull request #13207: [Scala][Clojure] Fix problem with some OSX not handling the cast on imDecode

gigasquid closed pull request #13207: [Scala][Clojure] Fix problem with some OSX not handling the cast on imDecode
URL: https://github.com/apache/incubator-mxnet/pull/13207
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/Image.scala b/scala-package/core/src/main/scala/org/apache/mxnet/Image.scala
index 43f81a22a40..77881ab940b 100644
--- a/scala-package/core/src/main/scala/org/apache/mxnet/Image.scala
+++ b/scala-package/core/src/main/scala/org/apache/mxnet/Image.scala
@@ -42,7 +42,7 @@ object Image {
   def imDecode(buf: Array[Byte], flag: Int,
                to_rgb: Boolean,
                out: Option[NDArray]): NDArray = {
-    val nd = NDArray.array(buf.map(_.toFloat), Shape(buf.length))
+    val nd = NDArray.array(buf.map( x => (x & 0xFF).toFloat), Shape(buf.length))
     val byteND = NDArray.api.cast(nd, "uint8")
     val args : ListBuffer[Any] = ListBuffer()
     val map : mutable.Map[String, Any] = mutable.Map()


 

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