oa::ml::nn::EmbeddingBag
Bag-of-embeddings lookup: embedding lookup followed by a per-bag reduction, covering the nn.EmbeddingBag contract. forward takes the flattened index matrix plus host offsets delimiting bags — the same boundary choice as torch.nn.EmbeddingBag(mode='mean'|'sum'), with offsets kept on the host side of the CPU/GPU contract because bag boundaries are data-shaping metadata, not device state. The bag loop composes slice + sum/mean + concat, so gradients flow through Embedding’s own adjoint into the shared weight — a composed contract, not a fused kernel.
Declaration
pub struct EmbeddingBag { /* private fields */ }Public Rust declaration.
Public Methods
Associated Functions
pub fn new_with_seed_on( runtime: &Runtime, num_embeddings: usize, embedding_dim: usize, mode: EmbeddingBagMode, seed: u64, ) -> Result<Self>Public Method Documentation
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.
No public source comment is attached to this declaration.