Browse Source

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

tags/v1.1.0
wangshuide2020 5 years ago
parent
commit
789123c5cd
4 changed files with 7 additions and 3 deletions
  1. +2
    -1
      mindspore/nn/layer/embedding.py
  2. +1
    -1
      mindspore/ops/composite/random_ops.py
  3. +2
    -1
      mindspore/ops/operations/array_ops.py
  4. +2
    -0
      mindspore/ops/operations/random_ops.py

+ 2
- 1
mindspore/nn/layer/embedding.py View File

@@ -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:


+ 1
- 1
mindspore/ops/composite/random_ops.py View File

@@ -258,7 +258,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()


+ 2
- 1
mindspore/ops/operations/array_ops.py View File

@@ -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`.



+ 2
- 0
mindspore/ops/operations/random_ops.py View File

@@ -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