parallelgithub commented on issue #9771: Modify NDArrayIter constructor to 
receive tuple (i.e. dict in Python)?
URL: https://github.com/apache/incubator-mxnet/pull/9771#issuecomment-365221525
 
 
   Thank you for replying. Would you please explain more about backwards 
compatibility?
   
   Since in our modified version we use `this` to overload the constructor, 
initialize NDArrayIter by 
   either this way 
   ```scala
   val trainData1 = IndexedSeq(NDArray.array(Array(1,2,3,4,5,6,3,2,7,1,6,9), 
shape = Shape(6,2)))
   val trainData2 = IndexedSeq(NDArray.array(Array(1,2,3,4,5,6,3,2,6,1,6,9), 
shape = Shape(6,2)))
   val trainLabel = IndexedSeq(NDArray.array(Array(5,11,17,7,9,24), shape = 
Shape(6)))
   val trainIter = new NDArrayIter(
     data = trainData1 ++ trainData2,
     label = trainLabel, 
     dataBatchSize = 1, 
     shuffle = false,
     lastBatchHandle = "pad",
     dataName = "data", 
     labelName = "label"
   )
   ```
   or this way
   ```scala
   val trainData1 = IndexedSeq(("user", 
NDArray.array(Array(1,2,3,4,5,6,3,2,7,1,6,9), shape = Shape(6,2))))
   val trainData2 = IndexedSeq(("item", 
NDArray.array(Array(1,2,3,4,5,6,3,2,6,1,6,9), shape = Shape(6,2))))
   val trainLabel = IndexedSeq(("label", NDArray.array(Array(5,11,17,7,9,24), 
shape = Shape(6))))
   val trainIter = new NDArrayIter(
     trainData1 ++ trainData2,
     trainLabel, 
     1, 
     false,
     "pad")
   ```
   is acceptable. So what is the detail about backwards compatibility?

----------------------------------------------------------------
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