From 31a95026c4ce0d044deda437ef55d225a26f6bf7 Mon Sep 17 00:00:00 2001 From: dzhwinter Date: Mon, 18 Feb 2019 00:29:19 +0800 Subject: [PATCH] cherry picked. test=develop --- .../paddle/fluid/transpiler/memory_optimization_transpiler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/paddle/fluid/transpiler/memory_optimization_transpiler.py b/python/paddle/fluid/transpiler/memory_optimization_transpiler.py index 52c1aea28..ee8cde441 100755 --- a/python/paddle/fluid/transpiler/memory_optimization_transpiler.py +++ b/python/paddle/fluid/transpiler/memory_optimization_transpiler.py @@ -355,6 +355,10 @@ class ControlFlowGraph(object): is_forward).dtype() cache_dtype = self._find_var(block_desc, cache_var, is_forward).dtype() + if x_dtype != cache_dtype: + if PRINT_LOG: + print("x_dtype and cache_dtype are different") + continue if not compare_shape(x_shape, cache_shape, level): continue -- GitLab