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/03/18 06:40:11 UTC

[GitHub] xiehust opened a new issue #10146: why the gluon.nn.embedding always return float32? seems cannot chang to float64.

xiehust opened a new issue #10146: why the gluon.nn.embedding always return float32? seems cannot chang to float64.
URL: https://github.com/apache/incubator-mxnet/issues/10146
 
 
   ## Description
   (Brief description of the problem in no more than 2 sentences.)
   I am using gluon.nn.embedding in my block, but it always return the output with dtype 'float32', thus it prevents me from concat another vector which has dtype 'float64'. Event if I set the dtype 'float64' or np.float64, it still doesn't work, and always output float32 value.
   
   ## Environment info (Required)
   windows 10
   mxnet:'1.1.0' build 20180213
   ```
   code:
   class Net(gluon.Block):
       def __init__(self, **kwargs):
           super(Net, self).__init__(**kwargs)
           with self.name_scope():
               # layers created in name_scope will inherit name space
               # from parent layer.
               self.tag1embedding = gluon.nn.Embedding(input_dim=tagdim,output_dim=output_dim,dtype=np.float64)
               self.dense1 = gluon.nn.Dense(1)
   
       def forward(self, x):
           b = self.tag1embedding(x[1])
           print (b.dtype)
           print (x[0].dtype)
           print (x[1].dtype)
           c=nd.concat(x[0],b,dim=1)
           y = self.dense1(c)
           return y
   --------
   the print output above is 
   <class 'numpy.float32'>
   <class 'numpy.float64'>
   <class 'numpy.float64'>
   
   

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