@@ -19,17 +19,17 @@ class Embedding(Module):
1919 padding_idx (int, optional): If given, pads the output with zeros whenever it encounters the index.
2020 max_norm (float, optional): If given, will renormalize the embeddings to always have a norm lesser than this
2121 norm_type (float, optional): The p of the p-norm to compute for the max_norm option
22- scale_grad_by_freq (boolean , optional): if given, this will scale gradients by the frequency of
22+ scale_grad_by_freq (bool , optional): if given, this will scale gradients by the frequency of
2323 the words in the mini-batch.
24- sparse (boolean , optional): if ``True``, gradient w.r.t. weight matrix will be a sparse tensor. See Notes for
24+ sparse (bool , optional): if ``True``, gradient w.r.t. weight matrix will be a sparse tensor. See Notes for
2525 more details regarding sparse gradients.
2626
2727 Attributes:
2828 weight (Tensor): the learnable weights of the module of shape (num_embeddings, embedding_dim)
2929
3030 Shape:
31- - Input: LongTensor `(N, W)`, N = mini-batch, W = number of indices to extract per mini-batch
32- - Output: `(N, W, embedding_dim)`
31+ - Input: LongTensor of arbitrary shape containing the indices to extract
32+ - Output: `(*, embedding_dim)`, where `*` is the input shape
3333
3434 Notes:
3535 Keep in mind that only a limited number of optimizers support
@@ -166,10 +166,10 @@ class EmbeddingBag(Module):
166166 embedding_dim (int): the size of each embedding vector
167167 max_norm (float, optional): If given, will renormalize the embeddings to always have a norm lesser than this
168168 norm_type (float, optional): The p of the p-norm to compute for the max_norm option
169- scale_grad_by_freq (boolean , optional): if given, this will scale gradients by the frequency of
169+ scale_grad_by_freq (bool , optional): if given, this will scale gradients by the frequency of
170170 the words in the dictionary.
171171 mode (string, optional): 'sum' | 'mean'. Specifies the way to reduce the bag. Default: 'mean'
172- sparse (boolean , optional): if ``True``, gradient w.r.t. weight matrix will be a sparse tensor. See Notes for
172+ sparse (bool , optional): if ``True``, gradient w.r.t. weight matrix will be a sparse tensor. See Notes for
173173 more details regarding sparse gradients.
174174
175175 Attributes:
0 commit comments