From 94a93d7dd1eeb87d4b0b66ac5d644456649aaca4 Mon Sep 17 00:00:00 2001 From: Yanzhan Yang Date: Tue, 22 Oct 2019 17:56:57 +0800 Subject: [PATCH] handle nan in run.py test=develop (#2240) --- mobile/tools/python/fluidtools/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/tools/python/fluidtools/run.py b/mobile/tools/python/fluidtools/run.py index 4773222536..6f82e426bd 100644 --- a/mobile/tools/python/fluidtools/run.py +++ b/mobile/tools/python/fluidtools/run.py @@ -559,7 +559,7 @@ def check_mobile_results(args, fuse, mem_opt): for i in range(len(values1)): v1 = values1[i] v2 = values2[len(shape) + i] - if abs(v1 - v2) > diff_threshold: + if ((not math.isnan(v1)) and math.isnan(v2)) or abs(v1 - v2) > diff_threshold: error_index = index break checked_names.append(op_output_var_name) -- GitLab