本文簡要介紹python語言中 torch.addcmul
的用法。
用法:
torch.addcmul(input, tensor1, tensor2, *, value=1, out=None) → Tensor
value(數字,可選的) - 的乘數
out(Tensor,可選的) -輸出張量。
執行
tensor1
與tensor2
的元素乘法,將結果乘以標量value
並將其添加到input
。tensor
、tensor1
和tensor2
的形狀必須是可廣播的。對於
FloatTensor
或DoubleTensor
類型的輸入,value
必須為實數,否則為整數。例子:
>>> t = torch.randn(1, 3) >>> t1 = torch.randn(3, 1) >>> t2 = torch.randn(1, 3) >>> torch.addcmul(t, t1, t2, value=0.1) tensor([[-0.8635, -0.6391, 1.6174], [-0.7617, -0.5879, 1.7388], [-0.8353, -0.6249, 1.6511]])
參數:
關鍵字參數:
相關用法
- Python PyTorch addcdiv用法及代碼示例
- Python PyTorch addmm用法及代碼示例
- Python PyTorch addmv用法及代碼示例
- Python PyTorch add用法及代碼示例
- Python PyTorch addbmm用法及代碼示例
- Python PyTorch addr用法及代碼示例
- Python PyTorch argsort用法及代碼示例
- Python PyTorch apply_effects_tensor用法及代碼示例
- Python PyTorch assert_close用法及代碼示例
- Python PyTorch angle用法及代碼示例
- Python PyTorch all_reduce用法及代碼示例
- Python PyTorch atanh用法及代碼示例
- Python PyTorch annotate用法及代碼示例
- Python PyTorch async_execution用法及代碼示例
- Python PyTorch argmax用法及代碼示例
- Python PyTorch atan用法及代碼示例
- Python PyTorch as_strided用法及代碼示例
- Python PyTorch acos用法及代碼示例
- Python PyTorch all_gather用法及代碼示例
- Python PyTorch avg_pool1d用法及代碼示例
- Python PyTorch asin用法及代碼示例
- Python PyTorch allreduce_hook用法及代碼示例
- Python PyTorch argmin用法及代碼示例
- Python PyTorch any用法及代碼示例
- Python PyTorch all_to_all用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.addcmul。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。