yzhliu commented on a change in pull request #11844: [MXNET-689] add DataDesc
type for the Scala Package
URL: https://github.com/apache/incubator-mxnet/pull/11844#discussion_r208722454
##########
File path: scala-package/core/src/main/scala/org/apache/mxnet/IO.scala
##########
@@ -352,7 +431,16 @@ object DataDesc {
* for each data-parallelism device.
*/
def getBatchAxis(layout: Option[String]): Int = {
- layout.map(_.indexOf('N')).getOrElse(0)
+ if (layout.isEmpty|| layout.get == Layout.UNDEFINED) {
+ logger.info("Found Undefined Layout, will use default index 0")
+ 0
+ } else {
+ if (layout.get.contains('N')) {
+ layout.get.indexOf("N")
+ } else {
+ throw new IllegalArgumentException("No N found in Batch Axis!")
Review comment:
incorrect indent ?
----------------------------------------------------------------
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