Browse Source

!15136 update example of sparsesoftmaxcorssentropywithlogits

From: @mind-lh
Reviewed-by: @liangchenghui,@wuxuejian
Signed-off-by: @liangchenghui
tags/v1.2.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
c29e6264c9
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/ops/operations/nn_ops.py

+ 1
- 1
mindspore/ops/operations/nn_ops.py View File

@@ -2350,7 +2350,7 @@ class SparseSoftmaxCrossEntropyWithLogits(PrimitiveWithInfer):
``GPU`` ``CPU``

Examples:
>>> logits = Tensor([[2, 4, 1, 4, 5], [2, 1, 2, 4, 3]], mindspore.float32)
>>> logits = Tensor([[2, 3, 1, 4, 5], [2, 1, 2, 4, 3]], mindspore.float32)
>>> labels = Tensor([0, 1], mindspore.int32)
>>> sparse_softmax_cross = ops.SparseSoftmaxCrossEntropyWithLogits()
>>> loss = sparse_softmax_cross(logits, labels)


Loading…
Cancel
Save