Python 矩阵乘法:10x20 矩阵乘以 20x30 矩阵
import numpy as np
定义 10x20 矩阵
matrix1 = np.random.rand(10, 20)
定义 20x30 矩阵
matrix2 = np.random.rand(20, 30)
矩阵乘法,得到 10x30 矩阵
result = np.dot(matrix1, matrix2)
print(result)
原文地址: https://www.cveoy.top/t/topic/lfus 著作权归作者所有。请勿转载和采集!