From 3a3017801b7dfc017d5e70ae4db876db294f8a17 Mon Sep 17 00:00:00 2001 From: Asthestarsfalll <72954905+Asthestarsfalll@users.noreply.github.com> Date: Mon, 1 Aug 2022 10:53:17 +0800 Subject: [PATCH] update document of quantile and nanquantile; test=document_fix (#42413) --- python/paddle/tensor/stat.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/paddle/tensor/stat.py b/python/paddle/tensor/stat.py index 2073e241a3b..1bf2df89855 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. -- GitLab