zachgk commented on a change in pull request #14668: [MXNET-1287] Feat dep
URL: https://github.com/apache/incubator-mxnet/pull/14668#discussion_r274628608
##########
File path:
scala-package/core/src/main/scala/org/apache/mxnet/io/PrefetchingIter.scala
##########
@@ -42,71 +42,51 @@ class PrefetchingIter(
require(iters.nonEmpty, "Iters length must be greater than 0")
- private val _provideData: ListMap[String, Shape] = {
+ @deprecated("Please use provideDataDesc instead", "1.3.0")
+ override def provideData: ListMap[String, Shape] = {
if (dataNames == null) {
- iters.map(_.provideData).foldLeft(ListMap[String, Shape]()) { (acc,
elem) =>
- acc ++ elem
- }
+ iters.map(_.provideData).reduce(_ ++ _)
} else {
- iters.zipWithIndex.map(tu => (tu._1.provideData, tu._2))
- .map(m => m._1.map(t => (dataNames(m._2)(t._1), t._2)))
- .foldLeft(ListMap[String, Shape]()) { (acc, elem) =>
- acc ++ elem
- }
+ iters.map(_.provideData).zip(dataNames).map { case (providedData, names)
=>
+ providedData.map { case (oldName, shape) => names(oldName) -> shape }
+ }.reduceLeft(_ ++ _)
}
}
- private val _provideLabel: ListMap[String, Shape] = {
+ @deprecated("Please use provideDataDesc instead", "1.3.0")
+ override def provideLabel: ListMap[String, Shape] = {
Review comment:
The _provideLabel was a private implementation of the externally accessible
provideLabel. I thought there was no point in having both so I combined them
and left the public one.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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