When I use torch.nn.functional.linear, I find sometimes the output is different with the outputs of multiplication of each line of A and W. For example, if A.shape is [1,2048,4096], W.shape is [4096,4096], res0 = F.linear(A, weight=B,bias=None), res0[0,0,0]=59598184. , but (A[0,0]*B[0]).sum() = 59598136.
I have try to change the type of A and B, but the results are always different.
New contributor
Arthur.Ling is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.