Browse Source

!15137 update example of sparsesoftmaxcorssentropywithlogits

From: @mind-lh
Reviewed-by: @liangchenghui,@wuxuejian
Signed-off-by: @liangchenghui
pull/15137/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
140cf61e29
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

@@ -2332,7 +2332,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