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 2019/09/17 02:09:56 UTC

[GitHub] [incubator-mxnet] ZhennanQin commented on issue #16177: How to dump quantized weights from MKLDNN as Ndarray

ZhennanQin commented on issue #16177: How to dump quantized weights from MKLDNN as Ndarray
URL: https://github.com/apache/incubator-mxnet/issues/16177#issuecomment-532027621
 
 
   Hi @shoubhik,
   Here's a demo code on how to dump mkldnn u8 convolution weights.
   https://github.com/ZhennanQin/incubator-mxnet/commit/c775dfc4f444a013302420112cc9c214fc59cd00
   
   For s8 convolution, mkldnn doesn't support to convert its s8 weight back to default format, thus you can't directly save them with aobve code. But you can still access its s8 weight in nhwc format:
   ```
   uint8_t* ptr = static_cast<uint8_t*>(cached_weight_.GetMKLDNNData()->get_data_handle()).
   ```
   You can write a loop to visit each element of it and save into a file.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services