nswamy commented on a change in pull request #11256: [MXNET-539] Allow Scala
users to specify data/label names for NDArrayIter
URL: https://github.com/apache/incubator-mxnet/pull/11256#discussion_r195579473
##########
File path:
scala-package/core/src/main/scala/org/apache/mxnet/io/NDArrayIter.scala
##########
@@ -154,16 +171,16 @@ class NDArrayIter (data: IndexedSeq[NDArray], label:
IndexedSeq[NDArray] = Index
newArray
}
- private def _getData(data: IndexedSeq[NDArray]): IndexedSeq[NDArray] = {
+ private def _getData(data: IndexedSeq[(String, NDArray)]):
IndexedSeq[NDArray] = {
require(cursor < numData, "DataIter needs reset.")
if (data == null) {
null
} else {
if (cursor + dataBatchSize <= numData) {
- data.map(ndArray => {ndArray.slice(cursor, cursor +
dataBatchSize)}).toIndexedSeq
+ data.map { case (_, ndArray) => ndArray.slice(cursor, cursor +
dataBatchSize) }
Review comment:
Is it the user's(of this API) responsiblity to dispose the slice handler?,
how would he know that.
----------------------------------------------------------------
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