Skip to content

Commit 277369a

Browse files
svekarspytorchmergebot
authored andcommitted
Move formulas on separate line in loss.py (pytorch#150565)
Move formulas on separate line in loss.py for better readability. Pull Request resolved: pytorch#150565 Approved by: https://github.com/mikaylagawarecki
1 parent a3f9e04 commit 277369a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/nn/modules/loss.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ class NLLLoss(_WeightedLoss):
154154
The unreduced (i.e. with :attr:`reduction` set to ``'none'``) loss can be described as:
155155
156156
.. math::
157-
\ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \quad
158-
l_n = - w_{y_n} x_{n,y_n}, \quad
157+
\ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \\
158+
l_n = - w_{y_n} x_{n,y_n}, \\
159159
w_{c} = \text{weight}[c] \cdot \mathbb{1}\{c \not= \text{ignore\_index}\},
160160
161161
where :math:`x` is the input, :math:`y` is the target, :math:`w` is the weight, and

0 commit comments

Comments
 (0)