RuRo commented on issue #16932: Detect unsupported usage of Gluon Hybridization
URL: 
https://github.com/apache/incubator-mxnet/issues/16932#issuecomment-559580968
 
 
   I think, that the bigger issue here is not that hybridization doesn't 
account for user defined conditions/branching, but that there is no way (?) to 
obtain information about the current execution mode after hybridization.
   
   If I understood you correctly, detecting "unsupported" usage for 
hybridization in Gluon would require introspecting user code inside 
`hybrid_forward`, which is not possible/reasonable IMO.
   
   What do you think about adding `mxnet.sym.is_training()` and 
`mxnet.nd.is_training()`? They should return a Symbol/Ndarray respectively, 
instead of a python bool. That way we could use 
`F.contrib.cond(F.is_training(), ...)` to emulate the desired behaviour.
   
   The current solution of "just create 2 models" is simply atrocious.

----------------------------------------------------------------
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

Reply via email to