标签:div for rand mat ica pytho pytorch class 矩阵
torch.mm(mat1, mat2) performs a matrix multiplication of mat1 and mat2
a = torch.randint(0, 5, (2, 3)) # tensor([[3, 3, 2],
# [2, 2, 2]])
b = torch.randint(0, 6, (3, 1)) # tensor([[1],
# [4],
# [5]])
torch.mm(a, b) # tensor([[11],
# [17]])
标签:div for rand mat ica pytho pytorch class 矩阵
原文地址:https://www.cnblogs.com/picassooo/p/12810626.html