!23936 update tensor api document

Merge pull request !23936 from huangbingjian/code_docs_tensor
This commit is contained in:
i-robot 2021-09-22 12:55:45 +00:00 committed by Gitee
commit b6f228cc48
1 changed files with 3 additions and 3 deletions

View File

@ -1920,7 +1920,7 @@ class RowTensor:
Examples: Examples:
>>> import mindspore as ms >>> import mindspore as ms
>>> import mindspore.nn as nn >>> import mindspore.nn as nn
>>> from mindspore import RowTensor >>> from mindspore import Tensor, RowTensor
>>> class Net(nn.Cell): >>> class Net(nn.Cell):
... def __init__(self, dense_shape): ... def __init__(self, dense_shape):
... super(Net, self).__init__() ... super(Net, self).__init__()
@ -1961,7 +1961,7 @@ class RowTensor:
class SparseTensor: class SparseTensor:
""" """
A sparse representation of a set of nonzero elememts from a tensor at given indices. A sparse representation of a set of nonzero elements from a tensor at given indices.
SparseTensor can only be used in the `Cell`'s construct method. SparseTensor can only be used in the `Cell`'s construct method.
@ -1985,7 +1985,7 @@ class SparseTensor:
Examples: Examples:
>>> import mindspore as ms >>> import mindspore as ms
>>> import mindspore.nn as nn >>> import mindspore.nn as nn
>>> from mindspore import SparseTensor >>> from mindspore import Tensor, SparseTensor
>>> class Net(nn.Cell): >>> class Net(nn.Cell):
... def __init__(self, dense_shape): ... def __init__(self, dense_shape):
... super(Net, self).__init__() ... super(Net, self).__init__()