nswamy commented on a change in pull request #13330: [MXNET-1222] Scala
Inference enable different shapes input
URL: https://github.com/apache/incubator-mxnet/pull/13330#discussion_r237301844
##########
File path:
scala-package/infer/src/main/scala/org/apache/mxnet/infer/Predictor.scala
##########
@@ -172,18 +189,20 @@ class Predictor(modelPathPrefix: String,
for((i, d) <- inputBatch.zip(iDescriptors)) {
require(inputBatch(0).shape(batchIndex) == i.shape(batchIndex),
"All inputs should be of same batch size")
- require(i.shape.drop(batchIndex + 1) == d.shape.drop(batchIndex + 1),
- s"Input Data Shape: ${i.shape} should match the inputDescriptor " +
- s"shape: ${d.shape} except batchSize")
+ if (!shapeCheckDisabled) {
+ require(i.shape.drop(batchIndex + 1) == d.shape.drop(batchIndex + 1),
+ s"Input Data Shape: ${i.shape} should match the inputDescriptor " +
+ s"shape: ${d.shape} except batchSize")
+ }
}
val inputBatchSize = inputBatch(0).shape(batchIndex)
// rebind with the new batchSize
if (batchSize != inputBatchSize) {
Review comment:
shouldn't you check here aswell ? you don't need to rebind if it already
does underneath even for batchSize ?
----------------------------------------------------------------
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