pishen commented on a change in pull request #9771: Modify NDArrayIter 
constructor to receive tuple (i.e. dict in Python)?
URL: https://github.com/apache/incubator-mxnet/pull/9771#discussion_r167922565
 
 

 ##########
 File path: scala-package/core/src/main/scala/ml/dmlc/mxnet/io/NDArrayIter.scala
 ##########
 @@ -38,15 +38,14 @@ import scala.collection.immutable.ListMap
  * the size of data does not match batch_size. Roll over is intended
  * for training and can cause problems if used for prediction.
  */
-class NDArrayIter (data: IndexedSeq[NDArray], label: IndexedSeq[NDArray] = 
IndexedSeq.empty,
-                  private val dataBatchSize: Int = 1, shuffle: Boolean = false,
-                  lastBatchHandle: String = "pad",
-                  dataName: String = "data", labelName: String = "label") 
extends DataIter {
+class NDArrayIter (data: IndexedSeq[(String, NDArray)], label: 
IndexedSeq[(String, NDArray)],
+                  private val dataBatchSize: Int, shuffle: Boolean,
+                  lastBatchHandle: String) extends DataIter {
 
 Review comment:
   As far as I know, the [auxiliary 
constructor](https://www.artima.com/pins1ed/functional-objects.html#6.7) in 
Scala is not able to call a function other than the primary constructor, hence 
it seems not possible to move the common constructor code into a function and 
call it by both constructors?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to