From ac9c7e4dec40d4a89dba0ea3ebfbcf82f05a824b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Tue, 10 Jan 2023 11:11:08 +0800 Subject: [PATCH] fix var->IsType() repeat judgment conditions (#49624) --- .../analysis/passes/ir_params_sync_among_devices_pass.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/inference/analysis/passes/ir_params_sync_among_devices_pass.cc b/paddle/fluid/inference/analysis/passes/ir_params_sync_among_devices_pass.cc index f325f2dec6..7557daa49e 100644 --- a/paddle/fluid/inference/analysis/passes/ir_params_sync_among_devices_pass.cc +++ b/paddle/fluid/inference/analysis/passes/ir_params_sync_among_devices_pass.cc @@ -63,7 +63,7 @@ void IrParamsSyncAmongDevicesPass::CopyParamsToNpu(Argument *argument) { var, platform::errors::PreconditionNotMet("The var should not be nullptr")); - if (var->IsType() || var->IsType()) { + if (var->IsType()) { auto *t = var->GetMutable(); platform::CPUPlace cpu_place; @@ -139,7 +139,7 @@ void IrParamsSyncAmongDevicesPass::CopyParamsToGpu(Argument *argument) { PADDLE_ENFORCE_NOT_NULL(var, platform::errors::PreconditionNotMet( "The var should not be nullptr")); - if (var->IsType() || var->IsType()) { + if (var->IsType()) { auto *t = var->GetMutable(); auto var_data_type = var_node->Var()->GetDataType(); VLOG(5) << "var_name is " << var_name << ", data type is " @@ -197,7 +197,7 @@ void IrParamsSyncAmongDevicesPass::CopyParamsToCustomDevice( var, platform::errors::PreconditionNotMet("The var should not be nullptr")); - if (var->IsType() || var->IsType()) { + if (var->IsType()) { auto *t = var->GetMutable(); platform::CPUPlace cpu_place; -- GitLab