!37260 gather算子文档修改
Merge pull request !37260 from ZengZitao/code_docs_gather_master
This commit is contained in:
commit
6602e6fbc0
|
@ -500,7 +500,7 @@ mindspore.Tensor
|
|||
|
||||
.. py:method:: gather(input_indices, axis)
|
||||
|
||||
返回指定 `axis` 上 `input_indices` 的元素对应的输入Tensor切片。为了方便描述,对于输入Tensor记为 `input_params`。
|
||||
返回指定 `axis` 上 `input_indices` 的元素对应的输入Tensor切片,输入Tensor的形状是 :math:`(x_1, x_2, ..., x_R)`。为了方便描述,对于输入Tensor记为 `input_params`。
|
||||
|
||||
.. note::
|
||||
1. input_indices 的值必须在 `[0, input_params.shape[axis])` 的范围内,结果未定义超出范围。
|
||||
|
|
|
@ -1184,7 +1184,6 @@ class Tensor(Tensor_):
|
|||
tensor_operator_registry.get('__sub__')(input_x, input_y)
|
||||
), tolerance)
|
||||
|
||||
|
||||
def matrix_determinant(self):
|
||||
"""
|
||||
Computes the determinant of one or more square matrices.
|
||||
|
@ -3277,19 +3276,13 @@ class Tensor(Tensor_):
|
|||
The shape of input tensor is :math:`(x_1, x_2, ..., x_R)`. For convenience, define it as `input_params`,
|
||||
the variable `input_params` refers to input tensor.
|
||||
|
||||
The following figure shows the calculation process of Gather commonly:
|
||||
|
||||
.. image:: Gather.png
|
||||
|
||||
where params represents the input `input_params`, and indices represents the index to be sliced `input_indices`.
|
||||
|
||||
.. note::
|
||||
Note:
|
||||
1.The value of `input_indices` must be in the range of `[0, input_param.shape[axis])`, the result
|
||||
is undefined out of range.
|
||||
is undefined out of range.
|
||||
|
||||
2.The data type of `input_params` cannot be
|
||||
`bool_ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.html#mindspore.dtype>`_ on Ascend
|
||||
platform currently.
|
||||
`bool_ <https://www.mindspore.cn/docs/en/master/api_python/mindspore.html#mindspore.dtype>`_ on Ascend
|
||||
platform currently.
|
||||
|
||||
Args:
|
||||
input_indices (Tensor): Index tensor to be sliced, the shape of tensor is :math:`(y_1, y_2, ..., y_S)`.
|
||||
|
@ -4301,7 +4294,6 @@ class Tensor(Tensor_):
|
|||
validator.check_is_int(seed2, 'seed2')
|
||||
return tensor_operator_registry.get('standard_laplace')(seed=seed, seed2=seed2)(self.shape)
|
||||
|
||||
|
||||
def xlogy(self, y):
|
||||
r"""
|
||||
Computes the first input tensor multiplied by the logarithm of second input tensor element-wise.
|
||||
|
@ -4345,7 +4337,6 @@ class Tensor(Tensor_):
|
|||
"""
|
||||
return tensor_operator_registry.get("xlogy")()(self, y)
|
||||
|
||||
|
||||
def erf(self):
|
||||
r"""
|
||||
Computes the Gauss error function of self tensor element-wise.
|
||||
|
@ -4371,7 +4362,6 @@ class Tensor(Tensor_):
|
|||
"""
|
||||
return tensor_operator_registry.get("erf")()(self)
|
||||
|
||||
|
||||
def erfc(self):
|
||||
r"""
|
||||
Computes the complementary error function of self tensor element-wise.
|
||||
|
@ -4657,8 +4647,8 @@ class COOTensor(COOTensor_):
|
|||
``GPU``
|
||||
"""
|
||||
shape = Tensor(self.shape)
|
||||
res_indices, res_values, _ = tensor_operator_registry.get("coalesce")(self.indices.transpose(), \
|
||||
self.values, shape)
|
||||
res_indices, res_values, _ = tensor_operator_registry.get("coalesce")(self.indices.transpose(),
|
||||
self.values, shape)
|
||||
return COOTensor(res_indices.transpose(), res_values, self.shape)
|
||||
|
||||
def to_csr(self):
|
||||
|
@ -5028,7 +5018,7 @@ class CSRTensor(CSRTensor_):
|
|||
[1. 2.]]
|
||||
"""
|
||||
validator.check_value_type('dense_matrix', dense_matrix, (Tensor_,), 'CSRTensor.mm')
|
||||
return tensor_operator_registry.get("csr_mm")()(self.indptr, self.indices, self.values, \
|
||||
return tensor_operator_registry.get("csr_mm")()(self.indptr, self.indices, self.values,
|
||||
self.shape, dense_matrix)
|
||||
|
||||
def sum(self, axis):
|
||||
|
@ -5143,4 +5133,5 @@ def _check_astype_and_convert(dtype):
|
|||
f" but got '{dtype}'.")
|
||||
return dtype
|
||||
|
||||
|
||||
tensor_operator_registry.register('vm_compare', _vm_compare)
|
||||
|
|
Loading…
Reference in New Issue