From de1ced1b92a8ee2e1989c780e52d9b3281c942dc Mon Sep 17 00:00:00 2001 From: Zhi Chen Date: Sat, 28 Mar 2020 23:54:32 +0000 Subject: [PATCH] a few more fixes --- include/tvm/ir/type.h | 4 +++- tests/python/frontend/caffe2/test_graph.py | 1 + tests/python/relay/test_ir_structural_equal_hash.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/tvm/ir/type.h b/include/tvm/ir/type.h index 6f6c66ad21079..0e65758a2e1c9 100644 --- a/include/tvm/ir/type.h +++ b/include/tvm/ir/type.h @@ -498,7 +498,9 @@ class IncompleteTypeNode : public TypeNode { } bool SEqualReduce(const IncompleteTypeNode* other, SEqualReducer equal) const { - return equal(kind, other->kind); + return + equal(kind, other->kind) && + equal.FreeVarEqualImpl(this, other); } void SHashReduce(SHashReducer hash_reduce) const { diff --git a/tests/python/frontend/caffe2/test_graph.py b/tests/python/frontend/caffe2/test_graph.py index d245f110eaf9f..d64b133bfd5e7 100644 --- a/tests/python/frontend/caffe2/test_graph.py +++ b/tests/python/frontend/caffe2/test_graph.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Test graph equality of caffe2 models.""" +import tvm from tvm import relay from tvm.relay import transform from model_zoo import c2_squeezenet, relay_squeezenet diff --git a/tests/python/relay/test_ir_structural_equal_hash.py b/tests/python/relay/test_ir_structural_equal_hash.py index cf626d702f4c6..5295e17d2e8b3 100644 --- a/tests/python/relay/test_ir_structural_equal_hash.py +++ b/tests/python/relay/test_ir_structural_equal_hash.py @@ -107,7 +107,7 @@ def test_func_type_sequal(): ft = relay.FuncType(tvm.runtime.convert([t1, t2]), tp1, tvm.runtime.convert([tp1, tp3]), tvm.runtime.convert([tr1])) - translate_vars = relay.FuncType(tvm.runtime.convert([t1, t2]), tp1, + translate_vars = relay.FuncType(tvm.runtime.convert([t1, t2]), tp2, tvm.runtime.convert([tp2, tp4]), tvm.runtime.convert([tr2])) assert ft == translate_vars