lanking520 closed pull request #13617: [MXNET-1257] fix the Float not showing
correctly problem
URL: https://github.com/apache/incubator-mxnet/pull/13617
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/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 8c48742e6f0..0466693be9b 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
}
----------------------------------------------------------------
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