nswamy commented on a change in pull request #12848: Fix Batch input issue with
Scala Benchmark
URL: https://github.com/apache/incubator-mxnet/pull/12848#discussion_r226490660
##########
File path:
scala-package/infer/src/main/scala/org/apache/mxnet/infer/ImageClassifier.scala
##########
@@ -182,7 +180,7 @@ object ImageClassifier {
resizedImage.flush()
// creating NDArray according to the input shape
- val pixelsArray = NDArray.array(result, shape = inputImageShape)
+ val pixelsArray = NDArray.array(result, shape = new Shape(1 +:
inputImageShape.toVector))
Review comment:
The forward operation most often contains a axis for Batch, either you can
do it here or outside the method just before you call forward. I think this is
fine or if you guys think we should outside that is also fine -- you can use
the NDArray.expand_dims() if it is a single dimension
The earlier version was wrong it was expecting the batch axis to be already
there.
----------------------------------------------------------------
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