From a524498efe8f1273bafe7e1a874ef272ce00bb1d Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Thu, 21 Sep 2017 12:55:46 +0800 Subject: [PATCH] fix the bug in TeamCity environment. --- paddle/framework/operator.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/paddle/framework/operator.h b/paddle/framework/operator.h index 4a078258d..82a23797d 100644 --- a/paddle/framework/operator.h +++ b/paddle/framework/operator.h @@ -342,10 +342,9 @@ class InferShapeContext { PADDLE_ENFORCE_LT(j, OutputSize(out)); auto* in_var = MultiInputVar(in)[i]; auto* out_var = MultiOutputVar(out)[j]; - PADDLE_ENFORCE(in_var->IsType(), - "The %d-th input of Input(%s) must be LoDTensor.", in); + if (!in_var->IsType()) return; PADDLE_ENFORCE(out_var->IsType(), - "The %d-th output of Output(%s) must be LoDTensor.", out); + "The %d-th output of Output(%s) must be LoDTensor.", j, out); auto in_tensor = in_var->Get(); auto* out_tensor = out_var->GetMutable(); out_tensor->set_lod(in_tensor.lod()); @@ -363,6 +362,13 @@ template <> const std::vector InferShapeContext::MultiInput( const std::string& name) const; +template <> +Tensor* InferShapeContext::Output(const std::string& name) const; + +template <> +std::vector InferShapeContext::MultiOutput( + const std::string& name) const; + template struct EigenDeviceConverter; -- GitLab