Closed Redmept1on closed 7 months ago
mindspore.ops.tensor_scatter_elements exist the same bug, when number in indices parameter exceed the range of size, there's no error message.
import mindspore
from mindspore import Tensor, ops
from mindspore import Parameter
import numpy as np
input_x = Parameter(Tensor(np.array([[1, 2, 3, 4, 5]]), mindspore.int32), name="x")
indices = Tensor(np.array([[10000, 4]]), mindspore.int32)
updates = Tensor(np.array([[8, 8]]), mindspore.int32)
axis = 1
reduction = "none"
output = ops.tensor_scatter_elements(input_x, indices, updates, axis, reduction)
print(output)
Environment
Hardware Environment(
Ascend
/GPU
/CPU
):device cpu
Software Environment:
Describe the current behavior
when index as a negative or positive number exceeds the range of size, no error is reported.
Describe the expected behavior
RuntimeError: index 10000 is out of bounds for dimension 1 with size 5
Steps to reproduce the issue
pytorch v2.0.0+cu117
Special notes for this issue
when set the number in index at 10000, the bug exists the same.