Closed xiaomengy closed 2 years ago
This PR add a groupby op to group the indices of input tensor by values.
Example:
x = torch.tensor([0, 0, 1, 2, 1]) values, groups = rlmeta.ops.groupby(x) # values: tensor([0, 1, 2]) # groups: (tensor([0, 1]), tensor([2, 4]), tensor([3]))
This PR add a groupby op to group the indices of input tensor by values.
Example: