Skip to content

Commit a524498

Browse files
committed
fix the bug in TeamCity environment.
1 parent 36aeb30 commit a524498

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

paddle/framework/operator.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,9 @@ class InferShapeContext {
342342
PADDLE_ENFORCE_LT(j, OutputSize(out));
343343
auto* in_var = MultiInputVar(in)[i];
344344
auto* out_var = MultiOutputVar(out)[j];
345-
PADDLE_ENFORCE(in_var->IsType<LoDTensor>(),
346-
"The %d-th input of Input(%s) must be LoDTensor.", in);
345+
if (!in_var->IsType<LoDTensor>()) return;
347346
PADDLE_ENFORCE(out_var->IsType<LoDTensor>(),
348-
"The %d-th output of Output(%s) must be LoDTensor.", out);
347+
"The %d-th output of Output(%s) must be LoDTensor.", j, out);
349348
auto in_tensor = in_var->Get<LoDTensor>();
350349
auto* out_tensor = out_var->GetMutable<LoDTensor>();
351350
out_tensor->set_lod(in_tensor.lod());
@@ -363,6 +362,13 @@ template <>
363362
const std::vector<const Tensor*> InferShapeContext::MultiInput<Tensor>(
364363
const std::string& name) const;
365364

365+
template <>
366+
Tensor* InferShapeContext::Output<Tensor>(const std::string& name) const;
367+
368+
template <>
369+
std::vector<Tensor*> InferShapeContext::MultiOutput<Tensor>(
370+
const std::string& name) const;
371+
366372
template <typename T>
367373
struct EigenDeviceConverter;
368374

0 commit comments

Comments
 (0)