Skip to content

Commit

Permalink
[Doc][Fix] Fix a typo in hybrid script tutorial. (apache#6525)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzh119 authored Sep 23, 2020
1 parent 232d5e7 commit d32026e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/langref/hybrid_script.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ you need to use ``tvm.te.hybrid.script`` decorator to indicate this is a hybrid
.. code-block:: python
@tvm.te.hybrid.script
def outer_product(a, b, c):
def outer_product(a, b):
c = output_tensor((100, 99), 'float32')
for i in range(a.shape[0]):
for j in range(b.shape[0]):
c[i, j] = a[i] * b[j]
return c
return c
a = numpy.random.randn(100)
b = numpy.random.randn(99)
c = outer_product(a, b)
Expand Down Expand Up @@ -76,7 +76,7 @@ or ``tvm.container.Array``, to this function, it returns a op node:
a = tvm.te.placeholder((100, ), name='a')
b = tvm.te.placeholder((99, ), name='b')
c = outer_product(a, b, c) # return the output tensor(s) of the operator
c = outer_product(a, b) # return the output tensor(s) of the operator
You can use any methods that can be applied on a TVM ``OpNode``, like create_schedule, although
so far, the functionality of schedule is as limited as ``ExternOpNode``. At least, it can be built
Expand Down Expand Up @@ -230,5 +230,8 @@ Assert statement is supported, you can simply use it as it is in standard Python

Keywords
~~~~~~~~
- For keywords: ``serial``, ``range``, ``unroll``, ``parallel``, ``vectorize``, ``bind``, ``const_expr``
- Math keywords: ``log``, ``exp``, ``sigmoid``, ``tanh``, ``power``, ``popcount``
- For keywords: ``serial``, ``range``, ``unroll``, ``parallel``, ``vectorize``, ``bind``, ``const_range``
- Math keywords: ``log``, ``exp``, ``sqrt``, ``rsqrt``, ``sigmoid``, ``tanh``, ``power``, ``popcount``, ``round``, ``ceil_div``
- Allocate keywords: ``allocate``, ``output_tensor``
- Data type keywords: ``uint8``, ``uint16``, ``uint32``, ``uint64``, ``int8``, ``int16``, ``int32``, ``int64``, ``float16``, ``float32``, ``float64``
- Others: ``max_num_threads``

0 comments on commit d32026e

Please sign in to comment.