You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/07/18 06:15:39 UTC
[GitHub] lanking520 commented on a change in pull request #11789:
[MXNET-319] Reduce Scala Warning messages
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:
users@infra.apache.org
With regards,
Apache Git Services