r"""Element-wise minimum of tensor elements. Compare two tensors and returns a new tensor containing the element-wise minima. If one of the elements being compared is a ``NaN``, then that element is returned. If both elements are ``NaNs`` then the first is returned. Args:
(x, y)
| 1001 | |
| 1002 | |
| 1003 | def minimum(x, y): |
| 1004 | r"""Element-wise minimum of tensor elements. |
| 1005 | |
| 1006 | Compare two tensors and returns a new tensor containing the element-wise minima. |
| 1007 | If one of the elements being compared is a ``NaN``, then that element is returned. |
| 1008 | If both elements are ``NaNs`` then the first is returned. |
| 1009 | |
| 1010 | Args: |
| 1011 | |
| 1012 | x: input tensor. Should have a numeric data type. |
| 1013 | y: input tensor. Should have the same data type as :math:`x`. |
| 1014 | |
| 1015 | Returns: |
| 1016 | |
| 1017 | a tensor containing the element-wise minima. |
| 1018 | The returned tensor must have the same data type as :math:`x`. |
| 1019 | |
| 1020 | Examples: |
| 1021 | >>> F.minimum(1, 2) |
| 1022 | Tensor(1, dtype=int32, device=xpux:0) |
| 1023 | |
| 1024 | Element-wise minimum: |
| 1025 | |
| 1026 | >>> x = Tensor([1, 2, 3, 4]) |
| 1027 | >>> y = Tensor([4, 3, 2, 1]) |
| 1028 | >>> F.minimum(x, y) |
| 1029 | Tensor([1 2 2 1], dtype=int32, device=xpux:0) |
| 1030 | |
| 1031 | Broadcasting: |
| 1032 | |
| 1033 | >>> x = Tensor([1, 2, 3, 4]) |
| 1034 | >>> F.minimum(x, 2) |
| 1035 | Tensor([1 2 2 2], dtype=int32, device=xpux:0) |
| 1036 | |
| 1037 | """ |
| 1038 | return _elwise(x, y, mode=Elemwise.Mode.MIN) |
| 1039 | |
| 1040 | |
| 1041 | def clip(x: Tensor, lower=None, upper=None) -> Tensor: |
no test coverage detected