You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/07/25 18:05:43 UTC

[GitHub] [incubator-mxnet] ptrendx opened a new pull request #15657: Eliminate common expressions

ptrendx opened a new pull request #15657: Eliminate common expressions
URL: https://github.com/apache/incubator-mxnet/pull/15657
 
 
   ## Description ##
   This PR introduces a graph pass that eliminates redundant common expressions in the graph. 
   
   For example, let's look at the graph created from a following Python code:
   ```
   a = mx.sym.Variable()
   out = (a + 5) * (a + 5)
   ```
   This graph will compute `a+5` twice, which is wasteful. After the pass introduced in this PR, the actual executed graph will be equivalent to
   ```
   a = mx.sym.Variable()
   b = a + 5
   out = b * b
   ```
   which computes the `a+5` only once.
   
   @eric-haibin-lin FYI
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [x] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
   - [x] Code is well-documented: 
   - For new C++ functions in header files, their functionalities and arguments are documented. 
   - [x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services