einsum和matmul的结果对比实验
程序:import torchimport torch.nn as nnt=torch.randn((2,3,2))w=torch.randn((3,2))einsum = torch.einsum('ijk,js->isk',t,w)print(einsum.shape,'einsum shape')print(einsum)t_T=t.transpose(2,1)result = torch.matmul(t_T,w).transpose(2,1)print(result.