MinkowskiUnion

MinkowskiUnion

class MinkowskiEngine.MinkowskiUnion

创建所有稀疏张量的并集,并添加重叠特征。

参数

警告

此功能是实验性的,用法可能会在未来的更新中更改。

__init__()

初始化内部 Module 状态,nn.Module 和 ScriptModule 共享。

forward(*inputs)
参数

可变数量的 MinkowskiEngine.SparseTensor

返回

一个 MinkowskiEngine.SparseTensor,坐标 = 所有输入坐标的并集,特征 = 对应于坐标的所有特征的总和。

示例

>>> # Define inputs
>>> input1 = SparseTensor(
>>>     torch.rand(N, in_channels, dtype=torch.double), coords=coords)
>>> # All inputs must share the same coordinate manager
>>> input2 = SparseTensor(
>>>     torch.rand(N, in_channels, dtype=torch.double),
>>>     coords=coords + 1,
>>>     coords_manager=input1.coordinate_manager,  # Must use same coords manager
>>>     force_creation=True  # The tensor stride [1, 1] already exists.
>>> )
>>> union = MinkowskiUnion()
>>> output = union(input1, iput2)