lanking520 commented on a change in pull request #11789: [MXNET-319] Reduce
Scala Warning messages
URL: https://github.com/apache/incubator-mxnet/pull/11789#discussion_r203261443
##########
File path: scala-package/core/src/main/scala/org/apache/mxnet/NDArray.scala
##########
@@ -89,7 +89,10 @@ object NDArray extends NDArrayBase {
output match {
case nd: NDArray => (Array(nd), Array(nd.handle))
case ndFuncRet: NDArrayFuncReturn => (ndFuncRet.arr,
ndFuncRet.arr.map(_.handle))
- case ndArr: Seq[NDArray] => (ndArr.toArray,
ndArr.toArray.map(_.handle))
+ case ndArr: Seq[NDArray @unchecked] =>
+ if (ndArr.head.isInstanceOf[NDArray]) (ndArr.toArray,
ndArr.toArray.map(_.handle))
Review comment:
Please check the Stackoverflow link above, the problem here is Scala cannot
identify the type T of a Seq[T]. We need to break it and check inside to make
sure it match our needs.
----------------------------------------------------------------
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