pytorch的matmul怎么广播

Posted wanggcong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pytorch的matmul怎么广播相关的知识,希望对你有一定的参考价值。

https://pytorch.org/docs/stable/notes/broadcasting.html#broadcasting-semantics

https://pytorch.org/docs/stable/torch.html?highlight=matmul#torch.matmul

# can line up trailing dimensions >>> x=torch.empty(5,3,4,1) >>> y=torch.empty( 3,1,1) # x and y are broadcastable. # 1st trailing dimension: both have size 1 # 2nd trailing dimension: y has size 1 # 3rd trailing dimension: x size == y size # 4th trailing dimension: y dimension doesn‘t exist


以上是关于pytorch的matmul怎么广播的主要内容,如果未能解决你的问题,请参考以下文章

PyTorch中的matmul函数详解

每天讲解一点PyTorch torch.matmul

每天讲解一点PyTorch torch.matmul

具有共享内存的 Pytorch 多处理导致 matmul 慢 30 倍(只有两个进程)

pytorch 乘法运算汇总与解析

Multiplication in PyTorch