nomnigraph - new utility for graph transformation#10081
Closed
duc0 wants to merge 1 commit intopytorch:masterfrom
Closed
nomnigraph - new utility for graph transformation#10081duc0 wants to merge 1 commit intopytorch:masterfrom
duc0 wants to merge 1 commit intopytorch:masterfrom
Conversation
Summary: Pull Request resolved: pytorch#10081 Add new utility that make it easier to write graph transformation. Callers now only need to take care of the actual transformation logic. The subgraph matching is simplified because callers only need to specify a simple construct for subtree matching criteria. The utlity is SubgraphMatcher::replaceSubtree Some notes: - replaceSubtree takes a subtree matching criteria, and a lambda that takes a subtree root. It does't not handle any transformations itself. Callers should be responsible for the transformation part, including deleting all nodes in the matched subtree(s). We could enhance this to also handle the deletion part if it turns out to be useful. - Only sub tree matching is supported for now but we can add general DAG sub-graph support later if needed. Reviewed By: bwasti Differential Revision: D9073297 fbshipit-source-id: 4fe7225dcc0e9a0db8dc94c810acb9122bee9a47
goodlux
pushed a commit
to goodlux/pytorch
that referenced
this pull request
Aug 15, 2018
Summary: Pull Request resolved: pytorch#10081 Add new utility that make it easier to write graph transformation. Callers now only need to take care of the actual transformation logic. The subgraph matching is simplified because callers only need to specify a simple construct for subtree matching criteria. The utlity is SubgraphMatcher::replaceSubtree Some notes: - replaceSubtree takes a subtree matching criteria, and a lambda that takes a subtree root. It does't not handle any transformations itself. Callers should be responsible for the transformation part, including deleting all nodes in the matched subtree(s). We could enhance this to also handle the deletion part if it turns out to be useful. - Only sub tree matching is supported for now but we can add general DAG sub-graph support later if needed. Reviewed By: bwasti Differential Revision: D9073297 fbshipit-source-id: 465a0ad11caafde01196fbb2eda2d4d8e550c3b6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add new utility that make it easier to write graph transformation. Callers now only need to take care of the actual transformation logic. The subgraph matching is simplified because callers only need to specify a simple construct for subtree matching criteria.
The utlity is SubgraphMatcher::replaceSubtree
Some notes:
Differential Revision: D9073297