Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
51d2e126
Commit
51d2e126
authored
6 years ago
by
Steven S. Lyubomirsky
Committed by
Tianqi Chen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Relay][Doc] Correct bad formatting and typos in Relay operator addition doc (#1833)
parent
417f0830
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/dev/relay_add_op.rst
+6
-3
6 additions, 3 deletions
docs/dev/relay_add_op.rst
with
6 additions
and
3 deletions
docs/dev/relay_add_op.rst
+
6
−
3
View file @
51d2e126
...
...
@@ -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.
Registering an operator requires three steps:
- Using the ``RELAY_REGISTER_OP`` macro in C++ to
register the operator's arity and type information
- Defining a C++ function to produce a call node for the
operator and registering a Python API hook for the function
- 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
``python/tvm/relay/op/tensor.py`` gives examples of the
last.
...
...
@@ -35,7 +36,7 @@ output type.
For example, see ``src/relay/op/type_relations.h`` and their
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
broadcast of the input types' shapes.
...
...
@@ -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
to specify the following information about an operator in Relay:
- Arity (number of arguments)
- Names and descriptions for positional arguments
- 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
supported externally)
- 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:
.. code:: c
...
...
@@ -141,6 +143,7 @@ before producing the call node:
Summary
-------
- A TVM operator can be registered in Relay using a relation to express
the appropriate type information.
- Using an operator in Relay requires a function to produce a
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment