!4350 fix the bias too big of the caffe model ml_bank_recog by fix qsort of the argmax

Merge pull request !4350 from zhaodezan/master
pull/4350/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit cfd37ca90d

@ -23,8 +23,11 @@ int ArgCompareAscFp32(const void *a, const void *b) {
} }
int ArgCompareDescFp32(const void *a, const void *b) { int ArgCompareDescFp32(const void *a, const void *b) {
return reinterpret_cast<const ArgElement *>(b)->data_.f_data_ // cmp funtion of qsort must return int type
- reinterpret_cast<const ArgElement *>(a)->data_.f_data_; auto b_value = reinterpret_cast<const ArgElement *>(b)->data_.f_data_;
auto a_value = reinterpret_cast<const ArgElement *>(a)->data_.f_data_;
int res = b_value > a_value ? 1 : -1;
return res;
} }
void ArgMaxDim0OutValue(const float *input, float *output, const int *in_shape, ArgMinMaxParameter *param) { void ArgMaxDim0OutValue(const float *input, float *output, const int *in_shape, ArgMinMaxParameter *param) {

Loading…
Cancel
Save