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/05/22 10:57:31 UTC

[GitHub] [incubator-mxnet] wuxun-zhang commented on issue #15038: [C++] fix type inconsistent issue when loading quantized parameters

wuxun-zhang commented on issue #15038: [C++] fix type inconsistent issue when loading quantized parameters
URL: https://github.com/apache/incubator-mxnet/pull/15038#issuecomment-494754515
 
 
   I wrote a simple test to reproduce this issue. 
   ```
   #include <iostream>
   #include <vector>
   #include "mxnet-cpp/MxNetCpp.h"
   using namespace mxnet::cpp;
   
   enum TypeFlag {
     kFloat32 = 0,
     kInt8 = 1
   };
   
   int main(void){
       std::vector<mx_uint> shape{4, 5, 6};
       int src_dtype = kInt8;
       Context context = Context::cpu(); 
       // specify the data type according to the input NDArray
       NDArray src(shape, context, true, src_dtype);
       NDArray dst;
       dst = src.Copy(context);
       std::cout<<"src.dtype = "<<src.GetDType()<<std::endl;
       std::cout<<"dst.dtype = "<<dst.GetDType()<<std::endl;
       return 0;
   }
   ```
   Before 
   ```
   src.dtype = 1
   dst.dtype = 0
   ```
   
   After
   ```
   src.dtype = 1
   dst.dtype = 1
   ```

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