anirudh2290 opened a new issue #15032: FC with bias ndim > 1 fails with MKLDNN
URL: https://github.com/apache/incubator-mxnet/issues/15032
 
 
   Minimum reproducible example:
   
   ```
   import numpy as np
   import mxnet as mx
   from mxnet.test_utils import *
   def test_fully_connected():
         data = mx.sym.var("data")
         fc_weight = mx.sym.var("weight")
         fc_bias = mx.sym.var("bias")
         fc = mx.sym.FullyConnected(data=data, weight=fc_weight, bias=fc_bias, 
num_hidden=10, no_bias=False, name='fc')
         data = mx.nd.random.uniform(shape=(5, 5, 5, 13), dtype=np.float32)
         fc_weight = mx.nd.random.uniform(shape=(10, 325), dtype=np.float32)
         fc_bias = mx.nd.random.uniform(shape=(10), dtype=np.float32)
         fc_bias2 = mx.nd.random.uniform(shape=(10, 1), dtype=np.float32)
         data_np = data.asnumpy().reshape(5, 325)
         fc_weight_np = np.transpose(fc_weight.asnumpy())
         fc_bias_np = fc_bias.asnumpy()
         res = np.dot(data_np, fc_weight_np) + fc_bias.asnumpy()
         check_symbolic_forward(fc, {'data': data_np, 'weight': 
fc_weight.asnumpy(), 'bias': fc_bias_np}, {'fc_output': res})
         check_numeric_gradient(fc, {'data': data_np, 'weight': 
fc_weight.asnumpy(), 'bias': fc_bias_np},
                                numeric_eps=1e-2, rtol=1e-4, atol=1e-2)
         # TODO: Fix Bug when bias has ndim > 1
         check_symbolic_forward(fc, {'data': data_np, 'weight': 
fc_weight.asnumpy(), 'bias': fc_bias2.asnumpy()}, {'fc_output': res})
   ```

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