|
|
@ -777,7 +777,7 @@ class InplaceAdd(PrimitiveWithInfer):
|
|
|
|
Adds v into specified rows of x. Computes y = x; y[i,] += v.
|
|
|
|
Adds v into specified rows of x. Computes y = x; y[i,] += v.
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
Args:
|
|
|
|
- **indices** (Union[int, tuple]) - Indices into the left-most dimension of x, and determines which rows of x
|
|
|
|
indices (Union[int, tuple]): Indices into the left-most dimension of x, and determines which rows of x
|
|
|
|
to add with v. It is a int or tuple, whose value is in [0, the first dimension size of x).
|
|
|
|
to add with v. It is a int or tuple, whose value is in [0, the first dimension size of x).
|
|
|
|
|
|
|
|
|
|
|
|
Inputs:
|
|
|
|
Inputs:
|
|
|
@ -789,7 +789,6 @@ class InplaceAdd(PrimitiveWithInfer):
|
|
|
|
Tensor, has the same shape and dtype as input.
|
|
|
|
Tensor, has the same shape and dtype as input.
|
|
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
|
|
|
|
>>> indices = [0, 1]
|
|
|
|
>>> indices = [0, 1]
|
|
|
|
>>> input_x = Tensor(np.array([[1, 2], [3, 4], [5, 6]]), mindspore.float32)
|
|
|
|
>>> input_x = Tensor(np.array([[1, 2], [3, 4], [5, 6]]), mindspore.float32)
|
|
|
|
>>> input_v = Tensor(np.array([[0.5, 1.0], [1.0, 1.5]]), mindspore.float32)
|
|
|
|
>>> input_v = Tensor(np.array([[0.5, 1.0], [1.0, 1.5]]), mindspore.float32)
|
|
|
@ -837,7 +836,7 @@ class InplaceSub(PrimitiveWithInfer):
|
|
|
|
Subtracts v into specified rows of x. Computes y = x; y[i, :] -= v; return y.
|
|
|
|
Subtracts v into specified rows of x. Computes y = x; y[i, :] -= v; return y.
|
|
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
Args:
|
|
|
|
- **indices** (Union[int, tuple]) - Indices into the left-most dimension of x, and determines which rows of x
|
|
|
|
indices (Union[int, tuple]): Indices into the left-most dimension of x, and determines which rows of x
|
|
|
|
to sub with v. It is a int or tuple, whose value is in [0, the first dimension size of x).
|
|
|
|
to sub with v. It is a int or tuple, whose value is in [0, the first dimension size of x).
|
|
|
|
|
|
|
|
|
|
|
|
Inputs:
|
|
|
|
Inputs:
|
|
|
|