Skip to content

Commit

Permalink
Fix rebase snags
Browse files Browse the repository at this point in the history
  • Loading branch information
slyubomirsky committed Jan 28, 2019
1 parent 430b27d commit 6a5a9e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/relay/ir/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void ModuleNode::Update(const Module& mod) {
Module ModuleNode::FromExpr(
const Expr& expr,
const tvm::Map<GlobalVar, Function>& global_funcs) {
auto mod = ModuleNode::make(global_funcs);
auto mod = ModuleNode::make(global_funcs, {});
auto func_node = expr.as<FunctionNode>();
Function func;
if (func_node) {
Expand Down
10 changes: 5 additions & 5 deletions src/relay/pass/type_infer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class TypeInferencer : private ExprFunctor<Type(const Expr&)>,

// Perform unification on two types and report the error at the expression
// or the span of the expression.
Type Unify(const Type& t1, const Type& t2, const Expr& expr) {
Type Unify(const Type& t1, const Type& t2, const NodeRef& expr) {
// TODO(tqchen, jroesch): propagate span to solver
try {
return solver_.Unify(t1, t2, expr);
Expand Down Expand Up @@ -148,7 +148,7 @@ class TypeInferencer : private ExprFunctor<Type(const Expr&)>,
return ret;
}

void ReportFatalError(const Expr& expr, const Error& err) {
void ReportFatalError(const NodeRef& expr, const Error& err) {
CHECK(this->current_func_.defined());
this->err_reporter.ReportAt(this->current_func_, expr, err);
this->err_reporter.RenderErrors(this->mod_);
Expand Down Expand Up @@ -214,7 +214,7 @@ class TypeInferencer : private ExprFunctor<Type(const Expr&)>,
unknown_args.push_back(IncompleteTypeNode::make(Kind::kType));
}
Type expected = TypeCallNode::make(con->con->belong_to, unknown_args);
Type unified = Unify(t, expected, con->span);
Type unified = Unify(t, expected, GetRef<NodeRef>(con));

auto* tc = unified.as<TypeCallNode>();
CHECK(tc) << "must be type call";
Expand Down Expand Up @@ -259,7 +259,7 @@ class TypeInferencer : private ExprFunctor<Type(const Expr&)>,
// if the definition is a function literal, permit recursion
bool is_functional_literal = let->value.as<FunctionNode>() != nullptr;
if (is_functional_literal) {
type_map_[op->var].checked_type = IncompleteTypeNode::make(Kind::kType);
type_map_[let->var].checked_type = IncompleteTypeNode::make(Kind::kType);
}

Type vtype = GetType(let->value);
Expand Down Expand Up @@ -685,7 +685,7 @@ Expr InferType(const Expr& expr, const Module& mod_ref) {
} else {
auto e = TypeInferencer(mod_ref, mod_ref->entry_func).Infer(expr);
CHECK(WellFormed(e));
auto free_tvars = FreeTypeVars(e);
auto free_tvars = FreeTypeVars(e, mod_ref);
CHECK(free_tvars.size() == 0)
<< "Found unbound type variables in " << e << ": " << free_tvars;
EnsureCheckedType(e);
Expand Down
2 changes: 1 addition & 1 deletion src/relay/pass/type_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ TVM_REGISTER_API("relay._ir_pass._test_type_solver")
} else if (name == "AddConstraint") {
return TypedPackedFunc<void(TypeConstraint)>([solver](TypeConstraint c) {
Expr e = VarNode::make("dummy_var",
IncompleteTypeNode::make(TypeVarNode::Kind::kType));
IncompleteTypeNode::make(Kind::kType));
return solver->AddConstraint(c, e);
});
} else {
Expand Down

0 comments on commit 6a5a9e3

Please sign in to comment.