xmuszq opened a new issue #17461: Initialize variable with  constant matrix 
(like ndarray) in symbol API
URL: https://github.com/apache/incubator-mxnet/issues/17461
 
 
   ## Description
   I want to initialize a variable with a constant nd  array in a symbol. It 
looks like the operation doesn't support it. A simple case:
           a=5; b=8192
           val_init_npy=[nd.zeros((a,b))];
           p_dropout_matrix = mx.symbol.Variable("dropout_matrix", 
shape=(num_fixed_dropout, len_dropout), init=mx.init.Constant(val_init_npy) )
   
   ### Error Message
    raise TypeError(repr(o) + " is not JSON serializable")
   
   
   ## To Reproduce
   In fact, in the doc for mx.init.Constant(val), it indicates the val could be 
a number or an ndarray. Not sure why it doesn't work. 
    
   Anyone has a good solution for it? 
   MANY THANKS!!
   

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