kaolin.ops.reduction

API

kaolin.ops.reduction.packed_simple_sum(tensor, numel_per_tensor)

Sum of each subtensor in a packed tensor with last_dim=1.

Parameters
  • tensor (torch.Tensor) – The input packed_tensor

  • numel_per_tensor (torch.LongTensor) – Tensor containing the number of element per sub-tensor.

Returns

A 1D tensor of size tensor.shape[0], containing the sum of each sub-tensor in the input tensor.

Return type

(torch.Tensor)