!49692 add sinh trunc tensor docs

Merge pull request !49692 from 冯一航/code_docs_add_sinh_trunc_docs
This commit is contained in:
i-robot 2023-03-03 09:02:35 +00:00 committed by Gitee
commit 0af059982f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 21 additions and 33 deletions

View File

@ -0,0 +1,6 @@
mindspore.Tensor.sinh
======================
.. py:method:: mindspore.Tensor.sinh()
详情请参考 :func:`mindspore.ops.sinh`

View File

@ -0,0 +1,6 @@
mindspore.Tensor.trunc
======================
.. py:method:: mindspore.Tensor.trunc()
详情请参考 :func:`mindspore.ops.trunc`

View File

@ -262,6 +262,7 @@ mindspore.Tensor
mindspore.Tensor.signbit
mindspore.Tensor.sin
mindspore.Tensor.sinc
mindspore.Tensor.sinh
mindspore.Tensor.size
mindspore.Tensor.slogdet
mindspore.Tensor.split
@ -294,6 +295,7 @@ mindspore.Tensor
mindspore.Tensor.tril
mindspore.Tensor.triu
mindspore.Tensor.true_divide
mindspore.Tensor.trunc
mindspore.Tensor.unbind
mindspore.Tensor.unfold
mindspore.Tensor.unique_consecutive

View File

@ -268,6 +268,7 @@
mindspore.Tensor.signbit
mindspore.Tensor.sin
mindspore.Tensor.sinc
mindspore.Tensor.sinh
mindspore.Tensor.size
mindspore.Tensor.slogdet
mindspore.Tensor.split
@ -300,6 +301,7 @@
mindspore.Tensor.tril
mindspore.Tensor.triu
mindspore.Tensor.true_divide
mindspore.Tensor.trunc
mindspore.Tensor.unbind
mindspore.Tensor.unfold
mindspore.Tensor.unique_consecutive

View File

@ -4183,23 +4183,7 @@ class Tensor(Tensor_, metaclass=_TensorMeta):
def sinh(self):
r"""
Computes hyperbolic sine of the input element-wise.
.. math::
out_i = \sinh(x_i)
Returns:
Tensor, has the same shape as input tensor.
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> x = Tensor(np.array([0.62, 0.28, 0.43, 0.62]), mindspore.float32)
>>> output = x.sinh()
>>> print(output)
[0.6604918 0.28367308 0.44337422 0.6604918]
For details, please refer to :func:`mindspore.ops.sinh`.
"""
self._init_check()
return tensor_operator_registry.get('sinh')(self)
@ -4250,19 +4234,7 @@ class Tensor(Tensor_, metaclass=_TensorMeta):
def trunc(self):
r"""
Returns a new tensor with the truncated integer values of the elements of input.
Returns:
Tensor, the same shape and dtype as the input.
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> x = Tensor(np.array([3.4742, 0.5466, -0.8008, -3.9079]),mindspore.float32)
>>> output = x.trunc()
>>> print(output)
[3. 0. 0. -3.]
For details, please refer to :func:`mindspore.ops.trunc`.
"""
self._init_check()
return tensor_operator_registry.get('trunc')(self)

View File

@ -1991,10 +1991,10 @@ def cov(x, *, correction=1, fweights=None, aweights=None):
Examples:
>>> import mindspore as ms
>>> import mindspore.ops as ops
>>> x = ms.Tensor([[0, 3], [5, 5], [7, 0]]).T
>>> x = ms.Tensor([[0., 3.], [5., 5.], [7., 0.]]).T
>>> print(x)
[[0 5 7]
[3 5 0]]
[[0. 5. 7.]
[3. 5. 0.]]
>>> print(ops.cov(x))
[[13. -3.5 ]
[-3.5 6.3333335]]