diff --git a/python/paddle/tensor/stat.py b/python/paddle/tensor/stat.py index 2073e241a3b183a154e9a1649b3f7f519caeb812..1bf2df89855ae4499d3f57cf4ca30364cae83ee6 100644 --- a/python/paddle/tensor/stat.py +++ b/python/paddle/tensor/stat.py @@ -440,8 +440,7 @@ def _compute_quantile(x, q, axis=None, keepdim=False, ignore_nan=False): Compute the quantile of the input along the specified axis. Args: - Args: - x (Tensor): The input Tensor, it's data type can be float32, float64. + x (Tensor): The input Tensor, it's data type can be float32, float64, int32, int64. q (int|float|list): The q for calculate quantile, which should be in range [0, 1]. If q is a list, each q will be calculated and the first dimension of output is same to the number of ``q`` . axis (int|list, optional): The axis along which to calculate quantile. ``axis`` should be int or list of int. @@ -525,7 +524,7 @@ def _compute_quantile(x, q, axis=None, keepdim=False, ignore_nan=False): if ignore_nan: indices.append(q_num * (valid_counts - 1)) else: - # TODO(Asthestarsfalll): Use paddle.index_fill instead of where + # TODO: Use paddle.index_fill instead of where index = q_num * (valid_counts - 1) last_index = x.shape[axis] - 1 nums = paddle.full_like(index, fill_value=last_index) @@ -569,7 +568,7 @@ def quantile(x, q, axis=None, keepdim=False): If any values in a reduced row are NaN, then the quantiles for that reduction will be NaN. Args: - x (Tensor): The input Tensor, it's data type can be float32, float64. + x (Tensor): The input Tensor, it's data type can be float32, float64, int32, int64. q (int|float|list): The q for calculate quantile, which should be in range [0, 1]. If q is a list, each q will be calculated and the first dimension of output is same to the number of ``q`` . axis (int|list, optional): The axis along which to calculate quantile. ``axis`` should be int or list of int. @@ -629,7 +628,7 @@ def nanquantile(x, q, axis=None, keepdim=False): If all values in a reduced row are NaN, then the quantiles for that reduction will be NaN. Args: - x (Tensor): The input Tensor, it's data type can be float32, float64. + x (Tensor): The input Tensor, it's data type can be float32, float64, int32, int64. q (int|float|list): The q for calculate quantile, which should be in range [0, 1]. If q is a list, each q will be calculated and the first dimension of output is same to the number of ``q`` . axis (int|list, optional): The axis along which to calculate quantile. ``axis`` should be int or list of int.