From f9518dc8b7e4dc60396b9bee23333feb6bfc31e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=BE=E9=9B=A8=E9=AD=94=E7=90=86=E6=B2=99?= Date: Tue, 16 Apr 2019 12:37:49 -0700 Subject: [PATCH] [Relay] Fix BatchMatMulRel typerelation (#3032) return false mean retry in the future, and in the case of error, it should be report ASAP, not retry. --- src/relay/op/nn/nn.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/relay/op/nn/nn.cc b/src/relay/op/nn/nn.cc index 2356634c4ed0..ae256629f3b1 100644 --- a/src/relay/op/nn/nn.cc +++ b/src/relay/op/nn/nn.cc @@ -658,7 +658,7 @@ bool BatchMatmulRel(const Array& types, const auto* x = types[0].as(); const auto* y = types[1].as(); if (x == nullptr || y == nullptr) return false; - if (x->shape.size() != 3 || y->shape.size() != 3) return false; + CHECK(x->shape.size() == 3 && y->shape.size() == 3); CHECK(reporter->AssertEQ(x->shape[0], y->shape[0])) << "BatchDot: batch dimension doesn't match, " << " x shape=" << x->shape