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


With regards,
Apache Git Services

Reply via email to