|
1369 | 1369 |
|
1370 | 1370 | :attr:`ord` defines the norm that is computed. The following norms are supported:
|
1371 | 1371 |
|
1372 |
| -====================== ========================= ======================================================== |
1373 |
| -:attr:`ord` norm for matrices norm for vectors |
1374 |
| -====================== ========================= ======================================================== |
1375 |
| -`None` (default) Frobenius norm `2`-norm (see below) |
1376 |
| -`'fro'` Frobenius norm -- not supported -- |
1377 |
| -`'nuc'` nuclear norm -- not supported -- |
1378 |
| -`inf` `max(sum(abs(x), dim=1))` `max(abs(x))` |
1379 |
| -`-inf` `min(sum(abs(x), dim=1))` `min(abs(x))` |
1380 |
| -`0` -- not supported -- `sum(x != 0)` |
1381 |
| -`1` `max(sum(abs(x), dim=0))` as below |
1382 |
| -`-1` `min(sum(abs(x), dim=0))` as below |
1383 |
| -`2` largest singular value as below |
1384 |
| -`-2` smallest singular value as below |
1385 |
| -other `int` or `float` -- not supported -- `sum(abs(x)^{ord})^{(1 / ord)}` |
1386 |
| -====================== ========================= ======================================================== |
| 1372 | +====================== ========================== ====================================================== |
| 1373 | +:attr:`ord` norm for matrices norm for vectors |
| 1374 | +====================== ========================== ====================================================== |
| 1375 | +`None` (default) Frobenius norm `2`-norm (see below) |
| 1376 | +`'fro'` Frobenius norm -- not supported -- |
| 1377 | +`'nuc'` nuclear norm -- not supported -- |
| 1378 | +`inf` `max(sum(abs(x), dim=1))` `max(abs(x))` |
| 1379 | +`-inf` `min(sum(abs(x), dim=1))` `min(abs(x))` |
| 1380 | +`0` -- not supported -- `sum(x != 0)` |
| 1381 | +`1` `max(sum(abs(x), dim=0))` as below |
| 1382 | +`-1` `min(sum(abs(x), dim=0))` as below |
| 1383 | +`2` largest `singular value`_ as below |
| 1384 | +`-2` smallest `singular value`_ as below |
| 1385 | +other `int` or `float` -- not supported -- `sum(abs(x)^{ord})^{(1 / ord)}` |
| 1386 | +====================== ========================== ====================================================== |
1387 | 1387 |
|
1388 | 1388 | where `inf` refers to `float('inf')`, NumPy's `inf` object, or any equivalent object.
|
1389 | 1389 |
|
|
1483 | 1483 | tensor([ 3.7417, 11.2250])
|
1484 | 1484 | >>> LA.norm(A[0, :, :]), LA.norm(A[1, :, :])
|
1485 | 1485 | (tensor(3.7417), tensor(11.2250))
|
| 1486 | +
|
| 1487 | +.. _singular value: |
| 1488 | + https://en.wikipedia.org/wiki/Singular_value_decomposition#Singular_values,_singular_vectors,_and_their_relation_to_the_SVD |
1486 | 1489 | """,
|
1487 | 1490 | )
|
1488 | 1491 |
|
|
0 commit comments