File tree Expand file tree Collapse file tree
beginner_source/hybrid_frontend Expand file tree Collapse file tree Original file line number Diff line number Diff 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
8181As mentioned, the computation is split into four parts. Part one is the
8282simple tensor calculation of :math:`|2x|`, which can be traced. Part two
8383is the iterative product calculation that represents a data dependent
8484control flow to be scripted (the number of loop iteration depends on the
8585input at runtime). Part three is a trace-able
86- :math:`\lfloor \sqrt{a/5} \r floor` calculation. Finally, part 4 handles
86+ :math:`\lfloor \sqrt{a/5} \\ rfloor` calculation. Finally, part 4 handles
8787the output cases depending on the value of :math:`z(x)` and must be
8888scripted due to the data dependency. Now, let's see how this looks in
8989code.
You can’t perform that action at this time.
0 commit comments