nswamy commented on a change in pull request #12833: [MXNET-1042] Module API
extension
URL: https://github.com/apache/incubator-mxnet/pull/12833#discussion_r226005653
##########
File path: scala-package/core/src/main/scala/org/apache/mxnet/javaapi/IO.scala
##########
@@ -32,3 +32,62 @@ object DataDesc{
def getBatchAxis(layout: String): Int =
org.apache.mxnet.DataDesc.getBatchAxis(Some(layout))
}
+
+class DataBatch(val dataBatch: org.apache.mxnet.DataBatch) {
+ def dispose() : Unit = dataBatch.dispose()
+
+ def provideDataDesc : Array[DataDesc] =
dataBatch.provideDataDesc.map(DataDesc.fromDataDesc).toArray
+
+ def provideLabelDesc : Array[DataDesc] =
dataBatch.provideLabelDesc.map(DataDesc.fromDataDesc).toArray
+}
+
+object DataBatch {
+ implicit def FromDataBatch(dataBatch : DataBatch) :
org.apache.mxnet.DataBatch = {
+ dataBatch.dataBatch
+ }
+
+ implicit def toDataBatch(dataBatch: org.apache.mxnet.DataBatch) : DataBatch
= {
+ new DataBatch(dataBatch)
+ }
+
+ class Builder() {
Review comment:
I thought you are using setters only for Optional fields?
----------------------------------------------------------------
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