本文整理汇总了Python中pycast.common.matrix.Matrix.matrix_multiplication_blockwise方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.matrix_multiplication_blockwise方法的具体用法?Python Matrix.matrix_multiplication_blockwise怎么用?Python Matrix.matrix_multiplication_blockwise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycast.common.matrix.Matrix
的用法示例。
在下文中一共展示了Matrix.matrix_multiplication_blockwise方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: blockwise_with_zero_expansion_test
# 需要导入模块: from pycast.common.matrix import Matrix [as 别名]
# 或者: from pycast.common.matrix.Matrix import matrix_multiplication_blockwise [as 别名]
def blockwise_with_zero_expansion_test(self):
a = Matrix(4, 4, [1, 2, 3, 0, 4, 5, 6, 0, 7, 8, 9, 0, 0, 0, 0, 0])
b = Matrix(4, 4, [1, 2, 3, 0, 4, 5, 6, 0, 7, 8, 9, 0, 0, 0, 0, 0])
calculated = a.matrix_multiplication_blockwise(b, 2)
result = Matrix(4, 4,
[30.000, 36.000, 42.000, 0, 66.000, 81.000, 96.000, 0,
102.000, 126.000, 150.000, 0, 0, 0, 0, 0]
)
self.assertEqual(result, calculated)
示例2: blockwise_multiplication_test
# 需要导入模块: from pycast.common.matrix import Matrix [as 别名]
# 或者: from pycast.common.matrix.Matrix import matrix_multiplication_blockwise [as 别名]
def blockwise_multiplication_test(self):
data = range(1, 33)
a = Matrix(4, 2, data[:8])
b = Matrix(6, 4, data[8:])
result = [ 210.000, 220.000, 230.000, 240.000, 250.000, 260.000,
498.000, 524.000, 550.000, 576.000, 602.000, 628.000]
resultMatrix = Matrix(6, 2, result)
calculated = a.matrix_multiplication_blockwise(b, 2)
self.assertEqual(resultMatrix, calculated)