Computes the minimum of elements across dimensions of a tensor. Reduces `input_tensor` along the dimensions given in `axis`. Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each entry in `axis`. If `keepdims` is true, the reduced dimensions are retained with length 1.
(input_tensor, axis=None, keepdims=False, name=None)
| 2093 | @tf_export("math.reduce_min", "reduce_min", v1=[]) |
| 2094 | @dispatch.add_dispatch_support |
| 2095 | def reduce_min(input_tensor, axis=None, keepdims=False, name=None): |
| 2096 | """Computes the minimum of elements across dimensions of a tensor. |
| 2097 | |
| 2098 | Reduces `input_tensor` along the dimensions given in `axis`. |
| 2099 | Unless `keepdims` is true, the rank of the tensor is reduced by 1 for each |
| 2100 | entry in `axis`. If `keepdims` is true, the reduced dimensions |
| 2101 | are retained with length 1. |
| 2102 | |
| 2103 | If `axis` is None, all dimensions are reduced, and a |
| 2104 | tensor with a single element is returned. |
| 2105 | |
| 2106 | Args: |
| 2107 | input_tensor: The tensor to reduce. Should have real numeric type. |
| 2108 | axis: The dimensions to reduce. If `None` (the default), reduces all |
| 2109 | dimensions. Must be in the range `[-rank(input_tensor), |
| 2110 | rank(input_tensor))`. |
| 2111 | keepdims: If true, retains reduced dimensions with length 1. |
| 2112 | name: A name for the operation (optional). |
| 2113 | |
| 2114 | Returns: |
| 2115 | The reduced tensor. |
| 2116 | |
| 2117 | @compatibility(numpy) |
| 2118 | Equivalent to np.min |
| 2119 | @end_compatibility |
| 2120 | """ |
| 2121 | keepdims = False if keepdims is None else keepdims |
| 2122 | return _may_reduce_to_scalar( |
| 2123 | keepdims, axis, |
| 2124 | gen_math_ops._min( |
| 2125 | input_tensor, _ReductionDims(input_tensor, axis), keepdims, |
| 2126 | name=name)) |
| 2127 | |
| 2128 | |
| 2129 | @tf_export(v1=["math.reduce_max", "reduce_max"]) |
no test coverage detected