[Relay][Prelude] Use the Relay parser to define the Relay prelude (#3043)
authorJared Roesch <roeschinc@gmail.com>
Tue, 11 Jun 2019 01:15:11 +0000 (18:15 -0700)
committereqy <eddieyan101@gmail.com>
Tue, 11 Jun 2019 01:15:11 +0000 (18:15 -0700)
commitc4245e3d05d7ce71ebb6fdabebd71f19f16463a3
tree07e758f28524eb7c996a2ef98e280fa86c702bfd
parent70041c4888015060388cfc35648b24cab70e28cc
[Relay][Prelude] Use the Relay parser to define the Relay prelude (#3043)

* Add ability to load Prelude from disk

* Port over id

* Define compose

* Linting errors and style changes

* Eliminate unnecessary parens

* Rename identType to typeIdent (makes more sense)

* Another unnecessary paren

* Bump the version number for the text format

* Ensure .rly (Relay text files) are permitted

* Correct release number and simplify grammar rule

* Correct load_prelude docstring

* Corrections to _parser

* Add Apache headers to prelude source file

* Remove test_prelude (redundant)

* Correct misleading error message

* Add check that parser is enabled in Prelude

* Commit pre-generated parser, ensure generated files are treated as binaries, and have parser tests always fire

* Permit parser files and git attributes files

* Exclude gitattributes and parser files from apache check

* Another attempt at appeasing Apache audit checker

* Corrections to rat-excludes

* Apache should be truly appeased now

* Ignore Relay parser files by name

* Mark parser files as generated so they don't show up on Github

* Add parsing helper function for tests

* Mark parser files as not detectable
26 files changed:
python/tvm/relay/_parser.py
python/tvm/relay/grammar/Relay.g4
python/tvm/relay/grammar/py2/.gitattributes [new file with mode: 0644]
python/tvm/relay/grammar/py2/.gitignore [deleted file]
python/tvm/relay/grammar/py2/Relay.interp [new file with mode: 0644]
python/tvm/relay/grammar/py2/Relay.tokens [new file with mode: 0644]
python/tvm/relay/grammar/py2/RelayLexer.interp [new file with mode: 0644]
python/tvm/relay/grammar/py2/RelayLexer.py [new file with mode: 0644]
python/tvm/relay/grammar/py2/RelayLexer.tokens [new file with mode: 0644]
python/tvm/relay/grammar/py2/RelayParser.py [new file with mode: 0644]
python/tvm/relay/grammar/py2/RelayVisitor.py [new file with mode: 0644]
python/tvm/relay/grammar/py3/.gitattributes [new file with mode: 0644]
python/tvm/relay/grammar/py3/.gitignore [deleted file]
python/tvm/relay/grammar/py3/Relay.interp [new file with mode: 0644]
python/tvm/relay/grammar/py3/Relay.tokens [new file with mode: 0644]
python/tvm/relay/grammar/py3/RelayLexer.interp [new file with mode: 0644]
python/tvm/relay/grammar/py3/RelayLexer.py [new file with mode: 0644]
python/tvm/relay/grammar/py3/RelayLexer.tokens [new file with mode: 0644]
python/tvm/relay/grammar/py3/RelayParser.py [new file with mode: 0644]
python/tvm/relay/grammar/py3/RelayVisitor.py [new file with mode: 0644]
python/tvm/relay/parser.py
python/tvm/relay/prelude.py
python/tvm/relay/prelude.rly [new file with mode: 0644]
tests/lint/check_file_type.py
tests/lint/rat-excludes
tests/python/relay/test_ir_parser.py