本文簡要介紹python語言中 torch.baddbmm 的用法。
用法:
torch.baddbmm(input, batch1, batch2, *, beta=1, alpha=1, out=None) → Tensorbeta(數字,可選的) -
input() 的乘數alpha(數字,可選的) - () 的乘數
out(Tensor,可選的) -輸出張量。
對
batch1和batch2中的矩陣執行批次 matrix-matrix 乘積。input添加到最終結果中。batch1和batch2必須是 3-D 張量,每個張量都包含相同數量的矩陣。如果
batch1是張量,batch2是張量,那麽input必須是可廣播的張量並且out將是張量。alpha和beta的含義與torch.addbmm()中使用的比例因子相同。如果
beta為0,則input將被忽略,其中的nan和inf不會被傳播。對於
FloatTensor或DoubleTensor類型的輸入,參數beta和alpha必須是實數,否則它們應該是整數。該運算符支持 TensorFloat32。
例子:
>>> M = torch.randn(10, 3, 5) >>> batch1 = torch.randn(10, 3, 4) >>> batch2 = torch.randn(10, 4, 5) >>> torch.baddbmm(M, batch1, batch2).size() torch.Size([10, 3, 5])
參數:
關鍵字參數:
相關用法
- Python PyTorch backward用法及代碼示例
- Python PyTorch batched_powerSGD_hook用法及代碼示例
- Python PyTorch bincount用法及代碼示例
- Python PyTorch bitwise_right_shift用法及代碼示例
- Python PyTorch bernoulli用法及代碼示例
- Python PyTorch bitwise_and用法及代碼示例
- Python PyTorch bitwise_not用法及代碼示例
- Python PyTorch binary_cross_entropy用法及代碼示例
- Python PyTorch bitwise_xor用法及代碼示例
- Python PyTorch binary_cross_entropy_with_logits用法及代碼示例
- Python PyTorch bleu_score用法及代碼示例
- Python PyTorch broadcast_tensors用法及代碼示例
- Python PyTorch build_vocab_from_iterator用法及代碼示例
- Python PyTorch broadcast_object_list用法及代碼示例
- Python PyTorch broadcast_shapes用法及代碼示例
- Python PyTorch bitwise_or用法及代碼示例
- Python PyTorch bitwise_left_shift用法及代碼示例
- Python PyTorch bf16_compress_wrapper用法及代碼示例
- Python PyTorch bmm用法及代碼示例
- Python PyTorch broadcast_to用法及代碼示例
- Python PyTorch bf16_compress_hook用法及代碼示例
- Python PyTorch bucketize用法及代碼示例
- Python PyTorch block_diag用法及代碼示例
- Python PyTorch frexp用法及代碼示例
- Python PyTorch jvp用法及代碼示例
注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.baddbmm。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
