forked from mindspore-Ecosystem/mindspore
add exception raises for inplace ops
This commit is contained in:
parent
cd18ed2815
commit
8273188f47
|
@ -639,6 +639,7 @@ mindspore.Tensor
|
|||
|
||||
- **TypeError** - `indices` 不是int或tuple。
|
||||
- **TypeError** - `indices` 是元组,但是其中的元素不是int。
|
||||
- **ValueError** - Tensor的shape与 `v` 的shape不同。
|
||||
|
||||
.. py:method:: inplace_sub(v, indices)
|
||||
|
||||
|
@ -660,6 +661,7 @@ mindspore.Tensor
|
|||
|
||||
- **TypeError** - `indices` 不是int或tuple。
|
||||
- **TypeError** - `indices` 是元组,但是其中的元素不是int。
|
||||
- **ValueError** - Tensor的shape与 `v` 的shape不同。
|
||||
|
||||
.. py:method:: inplace_update(v, indices)
|
||||
|
||||
|
@ -681,6 +683,7 @@ mindspore.Tensor
|
|||
|
||||
- **TypeError** - `indices` 不是int或tuple。
|
||||
- **TypeError** - `indices` 是元组,但是其中的元素不是int。
|
||||
- **ValueError** - Tensor的shape与 `v` 的shape不同。
|
||||
|
||||
.. py:method:: intopk(x, k)
|
||||
|
||||
|
|
|
@ -2088,6 +2088,11 @@ class Tensor(Tensor_):
|
|||
Returns:
|
||||
Tensor, with updated values.
|
||||
|
||||
Raises:
|
||||
TypeError: if indices is not int or tuple.
|
||||
TypeError: if indices is tuple but any of its element is not int.
|
||||
ValueError: the Tensor shape is different from that of v.
|
||||
|
||||
Supported Platforms:
|
||||
``Ascend`` ``CPU``
|
||||
|
||||
|
@ -2119,6 +2124,11 @@ class Tensor(Tensor_):
|
|||
Returns:
|
||||
Tensor, with values after adding.
|
||||
|
||||
Raises:
|
||||
TypeError: if indices is not int or tuple.
|
||||
TypeError: if indices is tuple but any of its element is not int.
|
||||
ValueError: the Tensor shape is different from that of v.
|
||||
|
||||
Supported Platforms:
|
||||
``Ascend`` ``CPU``
|
||||
|
||||
|
@ -2150,6 +2160,11 @@ class Tensor(Tensor_):
|
|||
Returns:
|
||||
Tensor, with values after subtracting.
|
||||
|
||||
Raises:
|
||||
TypeError: if indices is not int or tuple.
|
||||
TypeError: if indices is tuple but any of its element is not int.
|
||||
ValueError: the Tensor shape is different from that of v.
|
||||
|
||||
Supported Platforms:
|
||||
``Ascend`` ``CPU``
|
||||
|
||||
|
|
Loading…
Reference in New Issue