zhreshold commented on issue #8438: HybridBlocks don't work with constant 
NDArray initialized Parameters
URL: 
https://github.com/apache/incubator-mxnet/issues/8438#issuecomment-444602397
 
 
   @sernaton You can have a constant param by get_constant: 
https://mxnet.incubator.apache.org/api/python/gluon/gluon.html?highlight=get_constant#mxnet.gluon.ParameterDict.get_constant
   
   ```python
   filter_mask = ... # an nd.array
   self.filter_mask = self.params.get_constant('filter_mask', filter_mask)
   # no need to worry about initialization 
   ```
   This is way more elegant than what you are doing right now.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to