Skip to content

Commit

Permalink
me find type checker problem
Browse files Browse the repository at this point in the history
  • Loading branch information
MarisaKirisame committed Jun 28, 2019
1 parent 2e6f1bd commit cc02471
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 1 addition & 11 deletions src/relay/pass/type_infer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,7 @@ class TypeInferencer : private ExprFunctor<Type(const Expr&)>,
Type Unify(const Type& t1, const Type& t2, const NodeRef& expr) {
// TODO(tqchen, jroesch): propagate span to solver
try {
// instantiate higher-order func types when unifying because
// we only allow polymorphism at the top level
Type first = t1;
Type second = t2;
if (auto* ft1 = t1.as<FuncTypeNode>()) {
first = InstantiateFuncType(ft1);
}
if (auto* ft2 = t2.as<FuncTypeNode>()) {
second = InstantiateFuncType(ft2);
}
return solver_.Unify(first, second, expr);
return solver_.Unify(t1, t2, expr);
} catch (const dmlc::Error &e) {
this->ReportFatalError(
expr,
Expand Down
2 changes: 0 additions & 2 deletions tests/python/relay/test_pass_to_cps.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def test_ad_cps_pe():
stmt = relay.Let(f_ref, relay.RefCreate(unit),
relay.Let(relay.Var("x"), if_expr,
relay.Call(relay.RefRead(f_ref), [])))
stmt = unit# relay.RefCreate(unit)

F = relay.Function([cond], stmt)
print(F)
Expand All @@ -69,7 +68,6 @@ def test_ad_cps_pe():
F = relay.ir_pass.to_cps(F)
print(F)
relay.ir_pass.infer_type(F)
raise
F = relay.ir_pass.partial_evaluate(F)
print(F)

Expand Down

0 comments on commit cc02471

Please sign in to comment.