Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions python/tvm/relay/prelude.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def define_list_hd(self):
x = Var("x", self.l(a))
y = Var("y")
z = Var("z")
# Don't match nil() since it will break type checking
cons_case = Clause(PatternConstructor(self.cons, [PatternVar(y), PatternVar(z)]), y)
self.mod[self.hd] = Function([x], Match(x, [cons_case]), a, [a])

Expand All @@ -43,9 +42,8 @@ def define_list_tl(self):
x = Var("x", self.l(a))
y = Var("y")
z = Var("z")
nil_case = Clause(PatternConstructor(self.nil, []), self.nil())
cons_case = Clause(PatternConstructor(self.cons, [PatternVar(y), PatternVar(z)]), z)
self.mod[self.tl] = Function([x], Match(x, [nil_case, cons_case]), self.l(a), [a])
self.mod[self.tl] = Function([x], Match(x, [cons_case]), self.l(a), [a])

def define_list_nth(self):
"""Defines a function to get the nth element of a list.
Expand Down