sxjscience commented on issue #19118:
URL: 
https://github.com/apache/incubator-mxnet/issues/19118#issuecomment-691213582


   
   Forgot to add the `cast` in the example. The error I met is as follows:
   
   ```python
   import mxnet as mx
   mx.npx.set_np()
   net = mx.gluon.nn.Dense(16, in_units=16)
   net.cast("float16")
   net.initialize(ctx=mx.gpu())
   net.hybridize()
   net(mx.np.random.normal(0, 1, (16, 16), dtype=mx.np.float16, ctx=mx.gpu()))
   ```
   
   Error:
   ```
   MXNetError: Traceback (most recent call last):
     File "../src/imperative/./imperative_utils.h", line 306
   MXNetError: Check failed: outputs[i]->dtype() == out_types[i] (2 vs. 0) : 
0-th output has invalid dtype. Expecting 0 got 2 in operator _npi_uniform
   ```


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to