fix the example of MultiFieldEmbeddingLookup operator.

pull/12173/head
wangshuide2020 4 years ago
parent 8e091a923e
commit 6030cc83bd

@ -450,7 +450,7 @@ class MultiFieldEmbeddingLookup(EmbeddingLookup):
>>> input_indices = Tensor([[2, 4, 6, 0, 0], [1, 3, 5, 0, 0]], mindspore.int32)
>>> input_values = Tensor([[1, 1, 1, 0, 0], [1, 1, 1, 0, 0]], mindspore.float32)
>>> field_ids = Tensor([[0, 1, 1, 0, 0], [0, 0, 1, 0, 0]], mindspore.int32)
>>> net = nn.MultiFieldEmbeddingLookup(10, 2, field_size=2, operator='SUM')
>>> net = nn.MultiFieldEmbeddingLookup(10, 2, field_size=2, operator='SUM', target='DEVICE')
>>> out = net(input_indices, input_values, field_ids)
>>> print(out.shape)
(2, 2, 2)

@ -2325,8 +2325,8 @@ class SparseSoftmaxCrossEntropyWithLogits(PrimitiveWithInfer):
Raises:
TypeError: If `is_grad` is not a bool.
TypeError: If dtype of `logits' is neither float16 nor float32.
TypeError: If dtype of `labels' is neither int32 nor int64.
TypeError: If dtype of `logits` is neither float16 nor float32.
TypeError: If dtype of `labels` is neither int32 nor int64.
ValueError: If logits_shape[0] != labels_shape[0].
Supported Platforms:

Loading…
Cancel
Save