Skip to content

Commit

Permalink
update document of quantile and nanquantile; test=document_fix (#42413)
Browse files Browse the repository at this point in the history
  • Loading branch information
Asthestarsfalll authored Aug 1, 2022
1 parent c905a9e commit 3a30178
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions python/paddle/tensor/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 3a30178

Please sign in to comment.