Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7a32b02

Browse files
inkawhichJoelMarcey
authored andcommitted
fixed eqn issue with HF example
1 parent c02b728 commit 7a32b02

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

beginner_source/hybrid_frontend/learning_hybrid_frontend_through_example_tutorial.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,23 @@ class definitions.
6767
.. math::
6868
6969
Y(x) = \\begin{cases}
70-
\\frac{z(x)}{2} & \\text{if } z(x)\%2 == 0 \\
71-
z(x) & \\text{otherwise}
70+
\\frac{z(x)}{2} & \\text{if } z(x)\%2 == 0, \\\\
71+
z(x) & \\text{otherwise}
7272
\end{cases}
7373
7474
.. math::
7575
7676
\\begin{array}{| r | r |} \hline
77-
x &1 &2 &3 &4 &5 &6 &7 \\ \hline
78-
Y(x) &0 &0 &-5 &20 &190 &-4377 &-59051 \\ \hline
77+
x &1 &2 &3 &4 &5 &6 &7 \\\\ \hline
78+
Y(x) &0 &0 &-5 &20 &190 &-4377 &-59051 \\\\ \hline
7979
\end{array}
8080
8181
As mentioned, the computation is split into four parts. Part one is the
8282
simple tensor calculation of :math:`|2x|`, which can be traced. Part two
8383
is the iterative product calculation that represents a data dependent
8484
control flow to be scripted (the number of loop iteration depends on the
8585
input at runtime). Part three is a trace-able
86-
:math:`\lfloor \sqrt{a/5} \rfloor` calculation. Finally, part 4 handles
86+
:math:`\lfloor \sqrt{a/5} \\rfloor` calculation. Finally, part 4 handles
8787
the output cases depending on the value of :math:`z(x)` and must be
8888
scripted due to the data dependency. Now, let's see how this looks in
8989
code.

0 commit comments

Comments
 (0)