sernaton edited a comment on issue #8438: HybridBlocks don't work with constant 
NDArray initialized Parameters
URL: 
https://github.com/apache/incubator-mxnet/issues/8438#issuecomment-444350432
 
 
   correction: the workaround did work after some tweaking, An example:
   ```
   filter_mask = ... # an nd.array
   self.filter_mask = self.params.get( 'filter_mask', shape=filter_mask.shape, 
grad_req='null' )
   self.filter_mask.initialize()
   self.filter_mask.set_data( filter_mask )
   ```
   Plus making sure NOT to call force_reinit when initializing, otherwise it 
will overwrite your set_data.
   This is quite an ugly workaround - it comes also with a warning when running 
:)

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