feevos opened a new issue #9822: gluon HybridBlock wrapper of constant 
nd.array, is it possible?
URL: https://github.com/apache/incubator-mxnet/issues/9822
 
 
   Dear all,
   
   would it please be possible to provide a simple example of a HybridBlock 
wrapper around an nd.array object? I need to create a matrix object in numpy 
(it would be very time consuming to create it from scratch in nd.array - it?s 
basically BSplines definitions which already exist in python), and then 
transfer it to nd.array. Something like
   
   ```Python
   class ndarray_wrap(HybridBlock):
       def __init__(self, const_numpy_array, *kwards):
           HybridBlock.__init__(self,**kwards)
   
          # Some operations that take  constant const_numpy_array 
          # transforms it to a layer with no differentiation 
          self.constant_layer = ... 
   
   
       def hybrid_forward(self,F,x):
           return self.constant_layer
   ```
   
   such as it can be used in combination with other HybridBlocks and eventually 
hybridize the whole network?

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