On this page
torch.var
torch.var(input, dim, unbiased, keepdim=False, *, out=None) → Tensor
-
If
unbiased
isTrue
, Bessel’s correction will be used. Otherwise, the sample variance is calculated, without any correction.- Parameters:
- Keyword Arguments:
- torch.var(input, unbiased) Tensor
Calculates the variance of all elements in the
input
tensor.If
unbiased
isTrue
, Bessel’s correction will be used. Otherwise, the sample deviation is calculated, without any correction.- Parameters:
Example:
>>> a = torch.tensor([[-0.8166, -1.3802, -0.3560]]) >>> torch.var(a, unbiased=False) tensor(0.1754)
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/1.13/generated/torch.var.html