This is an automated email from the ASF dual-hosted git repository.

cmeier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 05dce1c  Fix problem with some OSX not handling the cast on imDecode 
(#13207)
05dce1c is described below

commit 05dce1c3cd1659cd003faefc68f1260db2b085aa
Author: Carin Meier <[email protected]>
AuthorDate: Sat Nov 10 13:33:10 2018 -0500

    Fix problem with some OSX not handling the cast on imDecode (#13207)
---
 scala-package/core/src/main/scala/org/apache/mxnet/Image.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 43f81a2..77881ab 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()

Reply via email to