You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/10/15 08:56:19 UTC

[GitHub] matanhs commented on issue #6087: mx.sym.constant

matanhs commented on issue #6087: mx.sym.constant
URL: https://github.com/apache/incubator-mxnet/issues/6087#issuecomment-429762374
 
 
   I've looked everywhere for a proper solution, didn't like the idea of using the special constant initializer class since there should not be a difference between scalar constant to any shape tensor. Finally what worked for me is the following: 
   my_var = mx.symbol.Variable('myconst',shape=(<shape>),init=mx.init.Constant(value=(a).tolist())
   if you also want to block gradients simply specify the variable name as constant variable when constructing the module.

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


With regards,
Apache Git Services