change error type

This commit is contained in:
zhaojichen 2020-04-23 05:29:26 -04:00
parent ff57caceb9
commit 8963e39516
2 changed files with 6 additions and 6 deletions

View File

@ -228,10 +228,10 @@ def test_exec():
raise_set = [
('Squeeze_1_Error', {
'block': (lambda x: P.Squeeze(axis=1.2), {'exception': ValueError}),
'block': (lambda x: P.Squeeze(axis=1.2), {'exception': TypeError}),
'desc_inputs': [Tensor(np.ones(shape=[3, 1, 5]))]}),
('Squeeze_2_Error', {
'block': (lambda x: P.Squeeze(axis=((1.2, 1.3))), {'exception': ValueError}),
'block': (lambda x: P.Squeeze(axis=((1.2, 1.3))), {'exception': TypeError}),
'desc_inputs': [Tensor(np.ones(shape=[3, 1, 5]))]}),
('ReduceSum_Error', {
'block': (lambda x: P.ReduceSum(keep_dims=1), {'exception': TypeError}),

View File

@ -401,16 +401,16 @@ def test_exec():
raise_set = [
('StridedSlice_1_Error', {
'block': (lambda x: P.StridedSlice(begin_mask="1"), {'exception': ValueError}),
'block': (lambda x: P.StridedSlice(begin_mask="1"), {'exception': TypeError}),
'desc_inputs': [0]}),
('StridedSlice_2_Error', {
'block': (lambda x: P.StridedSlice(end_mask="1"), {'exception': ValueError}),
'block': (lambda x: P.StridedSlice(end_mask="1"), {'exception': TypeError}),
'desc_inputs': [0]}),
('StridedSlice_3_Error', {
'block': (lambda x: P.StridedSlice(ellipsis_mask=1.1), {'exception': ValueError}),
'block': (lambda x: P.StridedSlice(ellipsis_mask=1.1), {'exception': TypeError}),
'desc_inputs': [0]}),
('StridedSlice_4_Error', {
'block': (lambda x: P.StridedSlice(new_axis_mask="1.1"), {'exception': ValueError}),
'block': (lambda x: P.StridedSlice(new_axis_mask="1.1"), {'exception': TypeError}),
'desc_inputs': [0]}),
]