Skip to content

Commit

Permalink
Revert "[Relay] Keep fixed dim when unifying dynamic shape (apache#5795
Browse files Browse the repository at this point in the history
…)"

This reverts commit 782190e.
  • Loading branch information
masa committed Oct 10, 2020
1 parent 6d0351a commit 30ab584
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
11 changes: 0 additions & 11 deletions src/relay/analysis/type_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,6 @@ class TypeSolver::Unifier : public TypeFunctor<Type(const Type&, const Type&)> {
if (ulhs.same_as(urhs)) {
return ulhs;
}

if (ulhs.as<AnyNode>() && urhs.as<tvm::IntImmNode>()) {
solver_->shape_uf_.Set(urhs, ulhs);
return urhs;
}

if (ulhs.as<tvm::IntImmNode>() && urhs.as<AnyNode>()) {
solver_->shape_uf_.Set(ulhs, urhs);
return ulhs;
}

if (ulhs.as<AnyNode>() || urhs.as<AnyNode>()) {
return Any();
}
Expand Down
11 changes: 0 additions & 11 deletions tests/python/relay/test_type_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from tvm import IRModule, te, relay, parser
from tvm.relay import op, transform, analysis
from tvm.relay import Any


def infer_mod(mod, annotate_spans=True):
Expand Down Expand Up @@ -388,16 +387,6 @@ def test_let_polymorphism():
tvm.ir.assert_structural_equal(body.checked_type, relay.TupleType([int32, relay.TupleType([])]))


def test_if():
choice_t = relay.FuncType([], relay.scalar_type("bool"))
f = relay.Var("f", choice_t)
true_branch = relay.Var("True", relay.TensorType([Any(), 1], dtype="float32"))
false_branch = relay.Var("False", relay.TensorType([Any(), Any()], dtype="float32"))
top = relay.Function([f, true_branch, false_branch], relay.If(f(), true_branch, false_branch))
ft = infer_expr(top)
tvm.ir.assert_structural_equal(ft.ret_type, relay.TensorType([Any(), 1], dtype="float32"))


def test_type_arg_infer():
code = """
#[version = "0.0.5"]
Expand Down

0 comments on commit 30ab584

Please sign in to comment.