TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.nn.functional.embedding_bag

tensorplay.nn.functional.embedding_bag(input: Tensor, weight: Tensor, offsets=None, max_norm=None, norm_type: float = 2, scale_grad_by_freq: bool = False, mode: str = 'mean', sparse: bool = False, per_sample_weights=None, include_last_offset: bool = False, padding_idx=None) → Tensor[source]

Compute sums, means or maxes of bags of embeddings.

1-D inputs with offsets (incl. include_last_offset), fixed length 2-D inputs, per_sample_weights (sum mode), padding_idx exclusion and max_norm renormalization. See tensorplay.nn.EmbeddingBag for details.

On this page

Ask DeepWiki