lanking520 commented on a change in pull request #13995: [MXNET-1287] Scala
compiler warnings
URL: https://github.com/apache/incubator-mxnet/pull/13995#discussion_r271964579
##########
File path:
scala-package/core/src/main/scala/org/apache/mxnet/module/Module.scala
##########
@@ -121,36 +121,35 @@ class Module(symbolVar: Symbol,
allowMissing: Boolean = false,
forceInit: Boolean = false,
allowExtra: Boolean = false): Unit = {
- if (paramsInitialized && !forceInit) {
- return
- }
- require(binded, "call bind before initializing the parameters")
+ if (!paramsInitialized || forceInit) {
+ require(binded, "call bind before initializing the parameters")
- if (this.argParams == null) {
- val paramArrays =
- execGroup.paramArrays.map(nds => NDArray.zeros(nds(0).shape, dtype =
nds(0).dtype))
- this.argParams = this.paramNames.zip(paramArrays).toMap
- }
+ if (this.argParams == null) {
Review comment:
Please don't introduce change like this
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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