- class GroupAccumulator¶
Accumulate embeddings and groups for group-based tasks.
Reset accumulator state
Reset accumulator status, accumulated embeddings and groups
- update(embeddings: Tensor, groups: Tensor, device=None)¶
Update accumulator state.
Move provided embeddings and groups to proper device and add to accumulated state.
embeddings – embeddings to accumulate
groups – corresponding groups to accumulate
device – device to store tensors on
- property groups¶
Concatenate list of groups to Tensor
Help to avoid concatenating groups for each batch during accumulation. Instead, concatenate it only on call.
torch.Tensor – batch of groups