Browse Source

update example of sparsesoftmaxcrossentropywithlogtis

pull/15137/head
liuhe 4 years ago
parent
commit
64b44b88c9
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