parallelgithub opened a new pull request #9771: Modify NDArrayIter constructor 
to receive tuple (i.e. dict in Python)?
   ## Description ##
   For multiple inputs or multiple labels in NDArrayIter, they are assigned 
IndexedSeq[NDArray] type, which is not flexible to design neural network like 
Python API because the naming rule here is dataname_0, dataname_1, etc. In more 
complex network you may want to give a meaningful names like "user" and "item" 
in Matrix Factorization example.
   We modify the constructor to receive IndexedSeq[(String, NDArray)] type to 
allow assigning custom names. We can initialize the NDArrayIter like this:
   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,
   In order to compatible with the old argument version, we overload the 

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:

With regards,
Apache Git Services

Reply via email to