From 27444326ab998d4b21181e8a23b72d9a0b7ff2db Mon Sep 17 00:00:00 2001 From: Aurelius84 Date: Fri, 14 Oct 2022 15:52:39 +0800 Subject: [PATCH] [Dy2St]Remove usless cast operation to speed up FP16 training (#46851) (#46998) --- .../fluid/dygraph/dygraph_to_static/partial_program.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py b/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py index c9e659cb68b..28053f00be9 100644 --- a/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py +++ b/python/paddle/fluid/dygraph/dygraph_to_static/partial_program.py @@ -599,16 +599,6 @@ class PartialProgramLayer: == paddle.float16): in_vars[i] = var.astype('float16') in_vars[i].name = name - if (self.forward_program.global_block().has_var(name) - and self.forward_program.global_block().var(name).dtype - == paddle.float16): - in_vars[i] = var.astype('float16') - in_vars[i].name = name - if (self.backward_program.global_block().has_var(name) - and self.backward_program.global_block().var(name).dtype - == paddle.float16): - in_vars[i] = var.astype('float16') - in_vars[i].name = name @property def program(self): -- GitLab