azai91 commented on issue #13625: add batch norm test
URL: https://github.com/apache/incubator-mxnet/pull/13625#issuecomment-446756514
 
 
   Yes, the test cases for BN is (for now) less stringent than the other C++ 
test cases. Normally, we run through a large set of fixtures (regular NDArray, 
mkldnn NDarray, reshaped, etc). However, in the BN implementation we are unable 
to handle reshaped mkldnn array. 
   
   For example, we cannot call GetMKLDNNData on views (reshaped) arrays 
https://github.com/apache/incubator-mxnet/blob/3d64d15e69ce6afba728a92b18753a868b6c3298/src/operator/nn/mkldnn/mkldnn_batch_norm-inl.h#L198
   
   
https://github.com/apache/incubator-mxnet/blob/3d64d15e69ce6afba728a92b18753a868b6c3298/src/operator/nn/mkldnn/mkldnn_batch_norm-inl.h#L394
   
   Normally, we call Reorder2Default in this case to produce a new array that 
isn't a view and then continue on. 
(https://github.com/apache/incubator-mxnet/blob/3d64d15e69ce6afba728a92b18753a868b6c3298/src/operator/nn/mkldnn/mkldnn_act.cc#L164).
 However, BN is special because we write to the inputs 
(https://github.com/apache/incubator-mxnet/blob/3d64d15e69ce6afba728a92b18753a868b6c3298/src/operator/nn/mkldnn/mkldnn_batch_norm-inl.h#L260),
 so making a copy of inputs, then writing to those copies will not have the 
desired effect.
   
   For now, all this PR does is provide test cases for our current 
implementations. 
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to