Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
51d2e126
Commit
51d2e126
authored
Oct 05, 2018
by
Steven S. Lyubomirsky
Committed by
Tianqi Chen
Oct 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Relay][Doc] Correct bad formatting and typos in Relay operator addition doc (#1833)
parent
417f0830
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
docs/dev/relay_add_op.rst
+6
-3
No files found.
docs/dev/relay_add_op.rst
View file @
51d2e126
...
@@ -6,13 +6,14 @@ operators need to be registered in Relay in order to ensure
...
@@ -6,13 +6,14 @@ operators need to be registered in Relay in order to ensure
that they will be integrated into Relay's type system.
that they will be integrated into Relay's type system.
Registering an operator requires three steps:
Registering an operator requires three steps:
- Using the ``RELAY_REGISTER_OP`` macro in C++ to
- Using the ``RELAY_REGISTER_OP`` macro in C++ to
register the operator's arity and type information
register the operator's arity and type information
- Defining a C++ function to produce a call node for the
- Defining a C++ function to produce a call node for the
operator and registering a Python API hook for the function
operator and registering a Python API hook for the function
- Wrapping the above Python API hook in a neater interface
- Wrapping the above Python API hook in a neater interface
The file ``src/relay/op/tensor/
elemwise
.cc`` provides
The file ``src/relay/op/tensor/
binary
.cc`` provides
examples of the first two steps, while
examples of the first two steps, while
``python/tvm/relay/op/tensor.py`` gives examples of the
``python/tvm/relay/op/tensor.py`` gives examples of the
last.
last.
...
@@ -35,7 +36,7 @@ output type.
...
@@ -35,7 +36,7 @@ output type.
For example, see ``src/relay/op/type_relations.h`` and their
For example, see ``src/relay/op/type_relations.h`` and their
implementations. E.g., ``BroadcastRel`` takes two input types and an
implementations. E.g., ``BroadcastRel`` takes two input types and an
output type, checks that they are all tensor types with the same underlyin
output type, checks that they are all tensor types with the same underlyin
g
data type, and finally ensures that the shape of the output type is the
data type, and finally ensures that the shape of the output type is the
broadcast of the input types' shapes.
broadcast of the input types' shapes.
...
@@ -44,6 +45,7 @@ if the existing ones do not capture the behavior of the desired operator.
...
@@ -44,6 +45,7 @@ if the existing ones do not capture the behavior of the desired operator.
The ``RELAY_REGISTER_OP`` macro in C++ allows a developer
The ``RELAY_REGISTER_OP`` macro in C++ allows a developer
to specify the following information about an operator in Relay:
to specify the following information about an operator in Relay:
- Arity (number of arguments)
- Arity (number of arguments)
- Names and descriptions for positional arguments
- Names and descriptions for positional arguments
- Support level (1 indicating an internal intrinsic, higher numbers
- Support level (1 indicating an internal intrinsic, higher numbers
...
@@ -51,7 +53,7 @@ indicating operators that are not as integral to the framework or are
...
@@ -51,7 +53,7 @@ indicating operators that are not as integral to the framework or are
supported externally)
supported externally)
- A type relation for the operator
- A type relation for the operator
The below example is from ``
elemwise
.cc`` and uses a broadcasting
The below example is from ``
binary
.cc`` and uses a broadcasting
add for tensors:
add for tensors:
.. code:: c
.. code:: c
...
@@ -141,6 +143,7 @@ before producing the call node:
...
@@ -141,6 +143,7 @@ before producing the call node:
Summary
Summary
-------
-------
- A TVM operator can be registered in Relay using a relation to express
- A TVM operator can be registered in Relay using a relation to express
the appropriate type information.
the appropriate type information.
- Using an operator in Relay requires a function to produce a
- Using an operator in Relay requires a function to produce a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment