Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit d4dbe7e

Browse files
authored
Merge pull request #31 from Moore123/lyxmoo
fix typo in introduction.rst
2 parents d32b333 + 0cbfa4b commit d4dbe7e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/source/introduction.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ Let's start with a simple example is a matrix vector product:
2424
.. code::
2525
2626
def mv(float(R,C) A, float(C) x) -> (o) {
27-
o(i) += A(i,j) * b(j)
27+
o(i) += A(i,j) * x(j)
2828
}
2929
3030
:code:`A` and :code:`x` are input tensors. :code:`o` is an output tensor.
31-
The statement :code:`o(i) += A(i,j)*b(j)` introduces two index variables :code:`i` and :code:`j`.
32-
Their range is inferred by their use indexing :code:`A` and :code:`b`. :code:`i = [0,R)`, :code:`j = [0,C)`.
31+
The statement :code:`o(i) += A(i,j)*x(j)` introduces two index variables :code:`i` and :code:`j`.
32+
Their range is inferred by their use indexing :code:`A` and :code:`x`. :code:`i = [0,R)`, :code:`j = [0,C)`.
3333
Because :code:`j` only appears on the right side,
3434
stores into :code:`o` will reduce over :code:`j` with the reduction specified for the loop.
3535
Reductions can occur across multiple variables, but they all share the same kind of associative reduction (e.g. :code:`+=`)
@@ -40,7 +40,7 @@ to maintain invariant (3). :code:`mv` computes the same thing as this C++ loop:
4040
for(int i = 0; i < R; i++) {
4141
o(i) = 0.0f;
4242
for(int j = 0; j < C; j++) {
43-
o(i) += A(i,j) * b(j);
43+
o(i) += A(i,j) * x(j);
4444
}
4545
}
4646
@@ -57,7 +57,7 @@ Simple matrix-vector
5757
.. code::
5858
5959
def mv(float(R,C) A, float(C) x) -> (o) {
60-
o(i) += A(i,j) * b(j)
60+
o(i) += A(i,j) * x(j)
6161
}
6262
6363
Simple matrix-multiply

0 commit comments

Comments
 (0)