pytorch_forecasting.utils.
groupby_apply
Groupby apply for torch tensors
keys – tensor of groups (0 to bins)
0
bins
values – values to aggregate - same size as keys
bins – total number of groups
reduction – either “mean” or “sum”
return_histogram – if to return histogram on top
tensor of size bins with aggregated values and optionally with counts of values