快捷方式

torch.Tensor.bernoulli

Tensor.bernoulli(*, generator=None) Tensor

返回一個結果張量,其中每個 result[i]\texttt{result[i]} 是獨立地從 Bernoulli(self[i])\text{Bernoulli}(\texttt{self[i]}) 採樣。self 必須具有浮點數 dtype,並且結果將具有相同的 dtype

請參閱 torch.bernoulli()

文件

獲取 PyTorch 的全面開發者文件

查看文件

教學

獲取針對初學者和高級開發者的深入教學

查看教學

資源

查找開發資源並獲得問題解答

查看資源