shape (num_embeddings, embedding_dim)
  * "per_sample_weights" (Tensor, optional). Has the same shape as
    "input".

  * "output": aggregated embedding values of shape *(B,
    embedding_dim)*

Examples:
  >>> # an Embedding module containing 10 tensors of size 3
  >>> embedding_matrix = torch.rand(10, 3)
  >>> # a batch of 2 samples of 4 indices each
  >>> input = torch.tensor([1, 2, 4, 5, 4, 3, 2, 9])
  >>> offsets = torch.tensor([0, 4])
  >>> F.embedding_bag(input, embedding_matrix, offsets)
  tensor([[ 0.3397,  0.3552,  0.5545],
          [ 0.5893,  0.4386,  0.5882]])

  >>> # example with padding_idx
  >>> embedding_matrix = torch.rand(10, 3)
  >>> input = torch.tensor([2, 2, 2, 2, 4, 3, 2, 9])
  >>> offsets = torch.tensor([0, 4])
  >>> F.embedding_bag(input, embedding_matrix, offsets, padding_idx=2, mode='sum')
  tensor([[ 0.0000,  0.0000,  0.0000],
          [-0.7082,  3.2145, -2.6251]])
