From 7664323940e7146ef3a974e5c9d9723f9cb032b7 Mon Sep 17 00:00:00 2001 From: Qing Date: Tue, 11 Dec 2018 11:34:08 -0800 Subject: [PATCH] fix the Float not showing correctly problem --- .../scala/org/apache/mxnet/infer/javaapi/Predictor.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scala-package/infer/src/main/scala/org/apache/mxnet/infer/javaapi/Predictor.scala b/scala-package/infer/src/main/scala/org/apache/mxnet/infer/javaapi/Predictor.scala index 8c48742e6f0d..0466693be9bc 100644 --- a/scala-package/infer/src/main/scala/org/apache/mxnet/infer/javaapi/Predictor.scala +++ b/scala-package/infer/src/main/scala/org/apache/mxnet/infer/javaapi/Predictor.scala @@ -80,10 +80,11 @@ class Predictor private[mxnet] (val predictor: org.apache.mxnet.infer.Predictor) An extra List is needed for when the model has more than one input. * @return Indexed sequence array of outputs */ - def predict(input: java.util.List[java.util.List[Float]]): - java.util.List[java.util.List[Float]] = { + def predict(input: java.util.List[java.util.List[java.lang.Float]]): + java.util.List[java.util.List[java.lang.Float]] = { val in = JavaConverters.asScalaIteratorConverter(input.iterator).asScala.toIndexedSeq - (predictor.predict(in map {a => a.asScala.toArray}) map {b => b.toList.asJava}).asJava + (predictor.predict(in map {a => a.asScala.map(Float2float).toArray}) + map {b => b.map(float2Float).toList.asJava}).asJava }