From 70b7c7edbbf416245a98784313fe45896aa51484 Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Tue, 16 Nov 2021 15:45:26 +0800 Subject: [PATCH] Removed unnecessary ENFORCE statement (#37219) --- paddle/fluid/imperative/layer.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/paddle/fluid/imperative/layer.cc b/paddle/fluid/imperative/layer.cc index 7c0b9d07823..24787c4ce33 100644 --- a/paddle/fluid/imperative/layer.cc +++ b/paddle/fluid/imperative/layer.cc @@ -403,9 +403,6 @@ void VarBase::_CopyGradientFrom(const VarBase& src) { platform::errors::InvalidArgument( "tensor has not been initialized", src.Name())); auto* grad_t = grad_var_->MutableVar()->GetMutable(); - PADDLE_ENFORCE_EQ(grad_t->IsInitialized(), true, - platform::errors::InvalidArgument( - "tensor %s has not been initialized", Name())); auto* var_ = MutableVar()->GetMutable(); grad_t->ShareDataWith(src_tensor); grad_t->Resize(var_->dims()); -- GitLab