r"""Calculates the minimum of tensor elements over a given axis (or axes). Args: inp: input tensor. Should have a numeric data type. axis: axis or axes along which minimums must be computed. By default, the minimum must be computed over the entire tensor.
(
inp: Tensor,
axis: Optional[Union[int, Sequence[int]]] = None,
keepdims: bool = False,
)
| 397 | |
| 398 | |
| 399 | def min( |
| 400 | inp: Tensor, |
| 401 | axis: Optional[Union[int, Sequence[int]]] = None, |
| 402 | keepdims: bool = False, |
| 403 | ) -> Tensor: |
| 404 | r"""Calculates the minimum of tensor elements over a given axis (or axes). |
| 405 | |
| 406 | Args: |
| 407 | inp: input tensor. Should have a numeric data type. |
| 408 | axis: axis or axes along which minimums must be computed. |
| 409 | By default, the minimum must be computed over the entire tensor. |
| 410 | If a sequence of integers, minimums must be computed over multiple axes. |
| 411 | keepdims: if ``True``, the reduced axes (dimensions) must be included in the result as singleton dimensions, |
| 412 | and, accordingly, the result must be compatible with the input tensor (see :ref:`broadcasting-rule`). |
| 413 | Otherwise, if ``False``, the reduced axes (dimensions) must not be included in the result. |
| 414 | |
| 415 | Returns: |
| 416 | if the minimum was computed over the entire tensor, a zero-dimensional tensor containing the minimum; |
| 417 | otherwise, a non-zero-dimensional tensor containing the minimums. |
| 418 | |
| 419 | .. admonition:: Special Cases |
| 420 | |
| 421 | If :math:`x_i` is ``NaN``, the minimum is ``NaN`` (i.e., ``NaN`` values propagate). |
| 422 | |
| 423 | Examples: |
| 424 | |
| 425 | >>> x = Tensor([[1, 2], [3, 4]]) |
| 426 | >>> F.min(x) |
| 427 | Tensor(1, dtype=int32, device=xpux:0) |
| 428 | |
| 429 | Along an axis: |
| 430 | |
| 431 | >>> F.min(x, axis=0) |
| 432 | Tensor([1 2], dtype=int32, device=xpux:0) |
| 433 | >>> F.min(x, axis=1) |
| 434 | Tensor([1 3], dtype=int32, device=xpux:0) |
| 435 | |
| 436 | """ |
| 437 | return inp.min(axis=axis, keepdims=keepdims) |
| 438 | |
| 439 | |
| 440 | def max( |
no test coverage detected