matteosal commented on issue #15767: FullyConnected op with float64 and MKL-DNN 
fails if gradient are not set in a specific way
URL: 
https://github.com/apache/incubator-mxnet/issues/15767#issuecomment-519040543
 
 
   I also get the same problem with `RNN`, but setting explicit gradients 
doesn't help in this case. It seems completely broken on float64:
   ```
   import mxnet as mx
   
   sym = mx.sym.RNN(
        mx.sym.Variable('in'), 
        mx.sym.Variable('par'), 
        mx.sym.Variable('s'), 
        state_size = (2),
        num_layers = 1,
        mode = 'rnn_tanh'
   )
   
   dtype = 'float64'
   explicit_grad = {
        'in': mx.nd.ones([2, 1, 2], dtype=dtype),
        'par': mx.nd.ones([12], dtype=dtype),
        's': mx.nd.ones([1, 1, 2], dtype=dtype)
   }
   
   args_grad = explicit_grad
   grad_req = 'write'
   
   ex = sym.bind(mx.cpu(), 
        {
                'in': mx.nd.ones([2, 1, 2], dtype=dtype),
                'par': mx.nd.ones([12], dtype=dtype),
                's': mx.nd.ones([1, 1, 2], dtype=dtype)
        },
        args_grad = args_grad,
        grad_req = grad_req
   )
   ex.forward()
   print(ex.outputs[0])
   ```
   
   Other RNN modes besides 'rnn_tanh' are also affected.

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