Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-319] Reduce Scala Warning messages #11789

Merged
merged 2 commits into from Jul 22, 2018

Conversation

lanking520
Copy link
Member

@lanking520 lanking520 commented Jul 17, 2018

Description

The previous JavaDoc generation is causing too much warning messages. This PR is intend to reduce the numbers of issues we have as indicated in #11603.

There are three fixs:

  • Seq[NDArray] erasure problem, same explained in here
  • Add <pre> tag on JavaDoc to reduce warnings
  • Minor fixing on the other files

@nswamy @yzhliu @andrewfayres

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@@ -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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why @unchecked and again the need to check if the head is a Instance of NDArray?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lanking520, would be great if you could add the link as a comment above the code.

@nswamy
Copy link
Member

nswamy commented Jul 22, 2018

Have you checked the javadoc generated?

@nswamy
Copy link
Member

nswamy commented Jul 22, 2018

#11603

@nswamy nswamy merged commit a94fcf9 into apache:master Jul 22, 2018
@lanking520 lanking520 deleted the warning-killer branch July 30, 2018 21:42
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants