Skip to content

Commit

Permalink
[Relay] Add ADTs to text format (apache#3863)
Browse files Browse the repository at this point in the history
* Getting closer to having ADT defs

* ADT defs working probly

* Match parsing basipally done

* came to earth in a silver chrome UFO

* match finished?

* All tests but newest are passing

* ADT constructors work

now cleanup?

* Cleanup round 1

* Cleanup round 2

* Cleanup round 3

* Cleanup round 4

* Cleanup round 6

* Cleanup round 7

* Lil grammar fix

* Remove ANTLR Java files

* Lint roller

* Lint roller

* Address feedback

* Test completeness in match test

* Remove unused imports

* Lint roller

* Switch to Rust-style ADT syntax

* Lil fix

* Add dummy `extern type` handler

* Add type arg to test

* Update prelude semantic version

* Repair test

* Fix graph var handling in match

* Revert 's/graph_equal/is_unifiable' change
  • Loading branch information
weberlo authored and wweic committed Sep 16, 2019
1 parent 595c2b7 commit 07fe745
Show file tree
Hide file tree
Showing 14 changed files with 3,059 additions and 1,458 deletions.
2 changes: 1 addition & 1 deletion include/tvm/relay/adt.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class MatchNode : public ExprNode {
/*! \brief The match node clauses. */
tvm::Array<Clause> clauses;

/*! \brief Should this match be complete (cover all cases)?
/*! \brief Should this match be complete (cover all cases)?
* If yes, the type checker will generate an error if there are any missing cases.
*/
bool complete;
Expand Down
7 changes: 7 additions & 0 deletions include/tvm/relay/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ class ModuleNode : public RelayNode {
*/
TVM_DLL TypeData LookupDef(const std::string& var) const;

/*!
* \brief Check if a global type definition exists
* \param var The name of the global type definition.
* \return Whether the definition exists.
*/
TVM_DLL bool HasDef(const std::string& var) const;

/*!
* \brief Look up a constructor by its tag.
* \param tag The tag for the constructor.
Expand Down
Loading

0 comments on commit 07fe745

Please sign in to comment.