masahi commented on a change in pull request #5676: URL: https://github.com/apache/incubator-tvm/pull/5676#discussion_r431481633
########## File path: docs/langref/relay_pattern.rst ########## @@ -28,17 +28,34 @@ Such a language is not just useful for building a rewriter but also providing ex In the backend world, we could use the same machinery to build a higher level API using bring your own code generation. This API takes set of patterns describing your hardware capabilities and an external compiler, providing a relatively smooth heterogeneous experience out of the box. -Examples -======== +Pattern Examples +================ -There are quite a few properties that are worth matching of operators below we examine how to match tree properties, and expand on some use cases that are not fully explored in the prototype. The first example is a simple case where we want to match one operator with a single input OR another operator with a single input, see the below diagram for a graphical representation and corresponding code:: +There are quite a few properties of operators that are worth matching. Below we examine how to match tree properties, and expand on some use cases that are not fully explored in the prototype. This section +demonstrates how to write patterns. It is recommended to check `tests/python/relay/test_dataflow_pattern.py`_ +for more use cases. + +.. _tests/python/relay/test_dataflow_pattern.py: https://github.com/apache/incubator-tvm/blob/master/tests/python/relay/test_dataflow_pattern.py + +Matching One of Two Ops +*********************** + +The first example is a simple case where we want to match one operator with a single input OR another operator with a single input, see the below diagram for a graphical representation and corresponding code: Review comment: there is no diagram ---------------------------------------------------------------- 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: [email protected]
