Skip to content

Commit 9720a13

Browse files
authored
Merge pull request #15756 from dzhwinter/picked/fix_py_opt
cherry picked. test=develop
2 parents 886beac + 889c11d commit 9720a13

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/paddle/fluid/transpiler/memory_optimization_transpiler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ def compare_shape(x_shape, cache_shape, opt_level):
355355
is_forward).dtype()
356356
cache_dtype = self._find_var(block_desc, cache_var,
357357
is_forward).dtype()
358+
if x_dtype != cache_dtype:
359+
if PRINT_LOG:
360+
print("x_dtype and cache_dtype are different!")
361+
continue
358362

359363
if not compare_shape(x_shape, cache_shape, level):
360364
continue

0 commit comments

Comments
 (0)