jmacglashan commented on issue #9822: gluon HybridBlock wrapper of constant 
nd.array, is it possible?
URL: 
https://github.com/apache/incubator-mxnet/issues/9822#issuecomment-366731099
 
 
   I would like better constant support for symbols (and consequently, 
`HybridBlock`s) as well.
   
   A workaround you can use for now though is to do it as follows. In the block 
that needs them, make your constants parameters; name each constant parameter 
something like 'constant_x' (this naming makes it impossible for usual 
initializer patterns to init them), assign the parameter a custom initializer 
that will set it to the right value and have your constant block wrap them with 
a block grad operation so that no optimization will ever touch them.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to