Class ov::op::v15::EmbeddingBagOffsets#

class EmbeddingBagOffsets : public ov::op::util::EmbeddingBagOffsetsBase#

Returns embeddings for given indices.

Public Functions

EmbeddingBagOffsets() = default#

Constructs a EmbeddingBagOffsets operation.

EmbeddingBagOffsets(const Output<Node> &emb_table, const Output<Node> &indices, const Output<Node> &offsets, const Output<Node> &default_index, const Output<Node> &per_sample_weights, const Reduction &reduction = Reduction::SUM)#

Constructs a EmbeddingBagOffsets operation.

EmbeddingBagOffsets constructs an output tensor by replacing every index in a given input tensor with a row (from the weights matrix) at that index

Parameters:
  • emb_table – tensor containing the embedding lookup table of the module of shape [num_emb, emb_dim1, emb_dim2, …] and of type T

  • indices – tensor of shape [num_indices] and of type T_IND. Required

  • offsets – tensor of shape [batch] and of type T_IND containing the starting index positions of each “bag” in indices. Required.

  • default_index – scalar of type T_IND containing default index in embedding table to fill empty “bags”. If set to value -1 or not provided, empty “bags” are filled with zeros. Reverse indexing using negative values is not supported. Optional.

  • per_sample_weights – tensor of the same shape as indices and of type T. Each value in this tensor are multiplied with each value pooled from embedding table for each index. Optional.

  • reduction – enum to select algorithm used to perform reduction of elements in bag. Optional.