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怎么广播的主要内容,如果未能解决你的问题,请参考以下文章