其他分享
首页 > 其他分享> > pytorch的matmul怎么广播

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

标签:torch,广播,pytorch,matmul,trailing,dimension,size
来源: https://www.cnblogs.com/Wanggcong/p/11001119.html