junrushao1994 commented on issue #16182: contrib.cond operator does not support parameterized block execution URL: https://github.com/apache/incubator-mxnet/issues/16182#issuecomment-532321515 Hey, thank you for asking! This is actually an expected behavior. The basic reason is that deferred initialization is not supported when control flow exists. Why we are reluctant to do this? Imagine, in a contrib.cond with two branches (then and else), so only one branch is executed each time. Just say, in a buggy code, if it goes to the first branch, deferred initialization may initialize the weight to some certain shape, but if it goes into the second branch, it may initialize the weight to some other different shape. In this case, this is highly tricky for us to figure out what on earth the actual shapes are in deferred initialization. Even if we are able to (actually we are not), it is not possible in current framework to produce exact error message for users to understand. Therefore, we finally decided that deferred initialization is not supported when control flow exists.
---------------------------------------------------------------- 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
