matmul
是open3d.core.Tensor
类的一个方法,用于计算两个张量的矩阵乘积。
matmul(self, other) -> Tensor
self
:一个形状为(m, n)
的张量other
:一个形状为(n, p)
的张量形状为(m, p)
的张量,表示两个张量的矩阵乘积。
import open3d.core as o3c
import numpy as np
a = np.ones((2, 3))
b = np.ones((3, 4))
o3c_a = o3c.Tensor(a)
o3c_b = o3c.Tensor(b)
result = o3c_a.matmul(o3c_b)
print(result)
# 输出:
# tensor([[3., 3., 3., 3.],
# [3., 3., 3., 3.]], device='cpu:0')
self
和other
是在GPU上的张量,则在GPU上执行操作。