forked from mindspore-Ecosystem/mindspore
!48779 [MS][LITE][OPS] fix div no nan op acc bug
Merge pull request !48779 from yefeng/521-fix_div_no_nan_acc_bug
This commit is contained in:
commit
fdf2009595
|
@ -475,9 +475,15 @@ struct DivNoNanFunc<half2> {
|
|||
__device__ __host__ __forceinline__ half2 operator()(const half2 &lhs, const half2 &rhs) {
|
||||
float2 l = __half22float2(lhs);
|
||||
float2 r = __half22float2(rhs);
|
||||
if ((r.x < kFloatEplison && r.x > -kFloatEplison) || (r.y < kFloatEplison && r.y > -kFloatEplison)) {
|
||||
if ((r.x < kFloatEplison && r.x > -kFloatEplison) && (r.y < kFloatEplison && r.y > -kFloatEplison)) {
|
||||
l.x = 0.0;
|
||||
l.y = 0.0;
|
||||
} else if ((r.x < kFloatEplison && r.x > -kFloatEplison)) {
|
||||
l.x = 0.0;
|
||||
l.y = l.y / r.y;
|
||||
} else if (r.y < kFloatEplison && r.y > -kFloatEplison) {
|
||||
l.x = l.x / r.x;
|
||||
l.y = 0.0;
|
||||
} else {
|
||||
l.x = l.x / r.x;
|
||||
l.y = l.y / r.y;
|
||||
|
|
|
@ -899,7 +899,7 @@ Status ModelPool::ParseSharedThreadPoolParam(const std::shared_ptr<RunnerConfig>
|
|||
std::map<std::string, std::map<std::string, std::string>> config_file_info;
|
||||
if (!runner_config->GetConfigPath().empty()) {
|
||||
int ret = lite::GetAllSectionInfoFromConfigFile(runner_config->GetConfigPath(), &config_file_info);
|
||||
if (ret != RET_OK) {
|
||||
if (ret != lite::RET_OK) {
|
||||
MS_LOG(ERROR) << "GetAllSectionInfoFromConfigFile failed.";
|
||||
return kLiteError;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue