modify numpy tensor

This commit is contained in:
liuyang_655 2021-09-27 05:56:50 -04:00
parent 6ee3d77709
commit 1211f943d2
2 changed files with 9 additions and 9 deletions

View File

@ -1228,7 +1228,7 @@ def test_tensor_slice_reduce_out_of_bounds_positive():
with pytest.raises(IndexError) as ex:
net(input_tensor)
assert "'begin' should be in [-6, 6) when 'shrink_axis_mask' is greater than 0, " \
"but got 'shrink_axis_mask': 7, 'strides': 1, 'begin': -7." in str(ex.value)
"but got 'shrink_axis_mask': 7, 'strides': 1, 'begin': 6." in str(ex.value)
@pytest.mark.level0

View File

@ -373,23 +373,23 @@ def test_itemset_by_tuple_with_number():
input_3d_np.itemset(index_np_3, value_np_2)
assert onp.all(output_3d_ms_2.asnumpy() == input_3d_np)
with pytest.raises(ValueError):
with pytest.raises(IndexError):
net(input_1d_ms, index_np_2, value_np_1)
with pytest.raises(ValueError):
with pytest.raises(IndexError):
net(input_1d_ms, index_np_2, value_np_2)
with pytest.raises(ValueError):
with pytest.raises(IndexError):
net(input_3d_ms, index_np_1, value_np_1)
with pytest.raises(ValueError):
with pytest.raises(IndexError):
net(input_3d_ms, index_np_1, value_np_2)
with pytest.raises(ValueError):
with pytest.raises(IndexError):
net(input_3d_ms, index_np_2, value_np_1)
with pytest.raises(ValueError):
with pytest.raises(IndexError):
net(input_3d_ms, index_np_2, value_np_2)
with pytest.raises(IndexError):
net(input_3d_ms, index_np_4, value_np_1)
with pytest.raises(IndexError):
net(input_3d_ms, index_np_4, value_np_2)
with pytest.raises(ValueError):
with pytest.raises(IndexError):
net(input_3d_ms, index_np_5, value_np_1)
with pytest.raises(ValueError):
with pytest.raises(IndexError):
net(input_3d_ms, index_np_5, value_np_2)