Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PatternLang] Add a relay LetPattern #7332

Merged
merged 3 commits into from
Jan 23, 2021
Merged

Conversation

mbrookhart
Copy link
Contributor

I found myself needing a Let pattern for some object detection work. Thanks for taking a look!

Copy link
Contributor

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a few typos.

python/tvm/relay/dataflow_pattern/__init__.py Outdated Show resolved Hide resolved
python/tvm/relay/dataflow_pattern/__init__.py Outdated Show resolved Hide resolved
@masahi
Copy link
Member

masahi commented Jan 23, 2021

I wonder, do we need to match against the let bound variable? Isn't it always Var? Not sure if relay Let supports pattern destructing on let lhs, like let (x, y) = ... in body

@mbrookhart
Copy link
Contributor Author

mbrookhart commented Jan 23, 2021

@masahi I agree the Expr will always be a var, but I wanted to let users match on more complicated attributes like name/dtype/shape/etc, so I left it a general in pattern

Matthew Brookhart and others added 2 commits January 22, 2021 19:12
Co-authored-by: Cody Yu <[email protected]>
Co-authored-by: Cody Yu <[email protected]>
@masahi masahi merged commit e889def into apache:main Jan 23, 2021
@masahi
Copy link
Member

masahi commented Jan 23, 2021

Thanks @mbrookhart @comaniac

alexwong pushed a commit to alexwong/tvm that referenced this pull request Feb 11, 2021
* Add a relay LetPattern

* fix If copy

Co-authored-by: Cody Yu <[email protected]>

* fix If copy

Co-authored-by: Cody Yu <[email protected]>

Co-authored-by: Cody Yu <[email protected]>
electriclilies pushed a commit to electriclilies/tvm that referenced this pull request Feb 18, 2021
* Add a relay LetPattern

* fix If copy

Co-authored-by: Cody Yu <[email protected]>

* fix If copy

Co-authored-by: Cody Yu <[email protected]>

Co-authored-by: Cody Yu <[email protected]>
Lokiiiiii pushed a commit to Lokiiiiii/tvm that referenced this pull request Mar 2, 2021
* Add a relay LetPattern

* fix If copy

Co-authored-by: Cody Yu <[email protected]>

* fix If copy

Co-authored-by: Cody Yu <[email protected]>

Co-authored-by: Cody Yu <[email protected]>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2021
* Add a relay LetPattern

* fix If copy

Co-authored-by: Cody Yu <[email protected]>

* fix If copy

Co-authored-by: Cody Yu <[email protected]>

Co-authored-by: Cody Yu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants