!10383 update the description of EmbeddingLookup operator and add output of multinomial operator.

From: @wangshuide2020
Reviewed-by: @liangchenghui,@wuxuejian
Signed-off-by: @liangchenghui
pull/10383/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 12602abd44

@ -173,7 +173,8 @@ class EmbeddingLookup(Cell):
Inputs:
- **input_indices** (Tensor) - The shape of tensor is :math:`(y_1, y_2, ..., y_S)`.
Specifies the indices of elements of the original Tensor. Values can be out of range of embedding_table,
and the exceeding part will be filled with 0 in the output. Input_indices must only be a 2d tensor in
and the exceeding part will be filled with 0 in the output. Values does not support negative and the result
is undefined if values are negative. Input_indices must only be a 2d tensor in
this interface when run in semi auto parallel/auto parallel mode.
Outputs:

@ -263,7 +263,7 @@ def multinomial(inputs, num_sample, replacement=True, seed=None):
>>> input = Tensor([0, 9, 4, 0], mstype.float32)
>>> output = C.multinomial(input, 2, True)
>>> print(output)
[1 2]
[1 1]
"""
shape = P.Shape()
reshape = P.Reshape()

@ -4580,7 +4580,8 @@ class EmbeddingLookup(PrimitiveWithInfer):
This represents a Tensor slice, instead of the entire Tensor. Currently, the dimension is restricted to be 2.
- **input_indices** (Tensor) - The shape of tensor is :math:`(y_1, y_2, ..., y_S)`.
Specifies the indices of elements of the original Tensor. Values can be out of range of `input_params`,
and the exceeding part will be filled with 0 in the output.
and the exceeding part will be filled with 0 in the output. Values does not support negative and the result
is undefined if values are negative.
- **offset** (int) - Specifies the offset value of this `input_params` slice. Thus the real indices
are equal to `input_indices` minus `offset`.

@ -498,6 +498,8 @@ class Multinomial(PrimitiveWithInfer):
>>> input = Tensor([0., 9., 4., 0.], mstype.float32)
>>> multinomial = ops.Multinomial(seed=10)
>>> output = multinomial(input, 2)
>>> print(output)
[2 1]
"""
@prim_attr_register

Loading…
Cancel
Save