From 6030cc83bde3af2076c41f38d6c87c46675275d2 Mon Sep 17 00:00:00 2001 From: wangshuide2020 <7511764+wangshuide2020@user.noreply.gitee.com> Date: Fri, 5 Feb 2021 15:26:32 +0800 Subject: [PATCH] fix the example of MultiFieldEmbeddingLookup operator. --- mindspore/nn/layer/embedding.py | 2 +- mindspore/ops/operations/nn_ops.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/nn/layer/embedding.py b/mindspore/nn/layer/embedding.py index 8745a8929c..d356cce714 100755 --- a/mindspore/nn/layer/embedding.py +++ b/mindspore/nn/layer/embedding.py @@ -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) diff --git a/mindspore/ops/operations/nn_ops.py b/mindspore/ops/operations/nn_ops.py index 349b45c2b8..6236aca697 100644 --- a/mindspore/ops/operations/nn_ops.py +++ b/mindspore/ops/operations/nn_ops.py @@ -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: