tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] lixiaoquan removed a comment on pull request #5656: [BYOC] Pattern Language MergeComposite
Date Wed, 27 May 2020 09:44:45 GMT

lixiaoquan removed a comment on pull request #5656:
URL: https://github.com/apache/incubator-tvm/pull/5656#issuecomment-634447632


   > @lixiaoquan fixed in that PR, but I didn't add your test because because I'm not sure
we're ready for that change to the TF test. Thoughts?
   
   Thanks a lot to fix it so quickly!
   
   I found another issue, if applying *rewrite()* on a function in Prelude, it will hang.
   It is ok to apply *partition()* on it.
   I use test_control_flow.py just because it will generate prelude functions in IRModule
   
   ```
   diff --git a/tests/python/frontend/tensorflow/test_control_flow.py b/tests/python/frontend/tensorflow/test_control_flow.py
   index 90035279b..a803c8264 100644
   --- a/tests/python/frontend/tensorflow/test_control_flow.py
   +++ b/tests/python/frontend/tensorflow/test_control_flow.py
   @@ -26,10 +26,24 @@ import numpy as np
    from tvm import nd
    from tvm import relay
    from tvm.relay.frontend.tensorflow import from_tensorflow
   +from tvm.relay.dataflow_pattern import *
    
    
   +add_pattern = is_op('add')(wildcard(), wildcard())
   +sub_pattern = is_op('subtract')(wildcard(), wildcard())
   +class TestRewrite(DFPatternCallback):
   +    def __init__(self):
   +        self.pattern = add_pattern
   +    def callback(self, pre, post, node_map):
   +        return post.args[0] - post.args[1]
   +
    def check_equal(graph, tf_out, input_map=None):
        mod, params = from_tensorflow(graph.as_graph_def(add_shapes=True))
   +
   +    print(mod['tensor_concatenate_int64'])
   +
   +    rewrite(TestRewrite(), mod['tensor_concatenate_int64'].body)
   +
        if input_map is not None:
            params.update(input_map)
        ex = relay.create_executor('vm', mod=mod)
   
   ```


----------------------------------------------------------------
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



Mime
View raw message