|
4069 | 4069 |
|
4070 | 4070 | add_docstr(torch._C.std, |
4071 | 4071 | """ |
4072 | | -.. function:: std(input) -> float |
| 4072 | +.. function:: std(input, unbiased=True) -> float |
4073 | 4073 |
|
4074 | 4074 | Returns the standard-deviation of all elements in the :attr:`input` Tensor. |
4075 | 4075 |
|
| 4076 | +If :attr:`unbiased` is false, then the standard-deviation will be calculated via |
| 4077 | +the biased estimator. Otherwise, Bessel's correction will be used. |
| 4078 | +
|
4076 | 4079 | Args: |
4077 | 4080 | input (Tensor): the input `Tensor` |
| 4081 | + unbiased (bool): whether to use the unbiased estimation or not |
4078 | 4082 |
|
4079 | 4083 | Example:: |
4080 | 4084 |
|
|
4088 | 4092 | 1.3782334731508061 |
4089 | 4093 |
|
4090 | 4094 |
|
4091 | | -.. function:: std(input, dim, keepdim=False, out=None) -> Tensor |
| 4095 | +.. function:: std(input, dim, keepdim=False, unbiased=True, out=None) -> Tensor |
4092 | 4096 |
|
4093 | 4097 | Returns the standard-deviation of each row of the :attr:`input` Tensor in the |
4094 | 4098 | given dimension :attr:`dim`. |
|
4098 | 4102 | Otherwise, :attr:`dim` is squeezed (see :func:`torch.squeeze`), resulting |
4099 | 4103 | in the output Tensor having 1 fewer dimension than :attr:`input`. |
4100 | 4104 |
|
| 4105 | +If :attr:`unbiased` is false, then the standard-deviation will be calculated via |
| 4106 | +the biased estimator. Otherwise, Bessel's correction will be used. |
| 4107 | +
|
4101 | 4108 | Args: |
4102 | 4109 | input (Tensor): the input `Tensor` |
4103 | 4110 | dim (int): the dimension to reduce |
4104 | 4111 | keepdim (bool): whether the output Tensor has :attr:`dim` retained or not |
| 4112 | + unbiased (bool): whether to use the unbiased estimation or not |
4105 | 4113 | out (Tensor, optional): the result Tensor |
4106 | 4114 |
|
4107 | 4115 | Example:: |
|
4709 | 4717 |
|
4710 | 4718 | add_docstr(torch._C.var, |
4711 | 4719 | """ |
4712 | | -.. function:: var(input) -> float |
| 4720 | +.. function:: var(input, unbiased=True) -> float |
4713 | 4721 |
|
4714 | 4722 | Returns the variance of all elements in the :attr:`input` Tensor. |
4715 | 4723 |
|
| 4724 | +If :attr:`unbiased` is false, then the variance will be calculated via the |
| 4725 | +biased estimator. Otherwise, Bessel's correction will be used. |
| 4726 | +
|
4716 | 4727 | Args: |
4717 | 4728 | input (Tensor): the input `Tensor` |
| 4729 | + unbiased (bool): whether to use the unbiased estimation or not |
4718 | 4730 |
|
4719 | 4731 | Example:: |
4720 | 4732 |
|
|
4728 | 4740 | 1.899527506513334 |
4729 | 4741 |
|
4730 | 4742 |
|
4731 | | -.. function:: var(input, dim, keepdim=False, out=None) -> Tensor |
| 4743 | +.. function:: var(input, dim, keepdim=False, unbiased=True, out=None) -> Tensor |
4732 | 4744 |
|
4733 | 4745 | Returns the variance of each row of the :attr:`input` Tensor in the given |
4734 | 4746 | dimension :attr:`dim`. |
|
4738 | 4750 | Otherwise, :attr:`dim` is squeezed (see :func:`torch.squeeze`), resulting in |
4739 | 4751 | the outputs Tensor having 1 fewer dimension than :attr:`input`. |
4740 | 4752 |
|
| 4753 | +If :attr:`unbiased` is false, then the variance will be calculated via the |
| 4754 | +biased estimator. Otherwise, Bessel's correction will be used. |
| 4755 | +
|
4741 | 4756 | Args: |
4742 | 4757 | input (Tensor): the input `Tensor` |
4743 | 4758 | dim (int): the dimension to reduce |
4744 | 4759 | keepdim (bool): whether the output Tensor has :attr:`dim` retained or not |
| 4760 | + unbiased (bool): whether to use the unbiased estimation or not |
4745 | 4761 | out (Tensor, optional): the result Tensor |
4746 | 4762 |
|
4747 | 4763 | Example:: |
|
0 commit comments