torch.Tensor.geometric_¶
- Tensor.geometric_(p, *, generator=None) Tensor ¶
Fills
self
tensor with elements drawn from the geometric distribution:\[P(X=k) = (1 - p)^{k - 1} p, k = 1, 2, ...\]Note
torch.Tensor.geometric_()
k-th trial is the first success hence draws samples in \(\{1, 2, \ldots\}\), whereastorch.distributions.geometric.Geometric()
\((k+1)\)-th trial is the first success hence draws samples in \(\{0, 1, \ldots\}\).