Fixed numpy deprecation error (#20375)
This commit is contained in:
parent
c61fce428e
commit
b3ead62631
@ -13,7 +13,7 @@ test_params = [
|
||||
'shape_shape': [1], 'shape_value': [8]},
|
||||
{'indices_shape': [4, 1], 'indices_value': [4, 3, 1, 7], 'updates_dtype': np.float32, 'updates_shape': [4],
|
||||
'shape_shape': [1], 'shape_value': [8]},
|
||||
{'indices_shape': [4, 1], 'indices_value': [4, 3, 1, 7], 'updates_dtype': np.bool, 'updates_shape': [4],
|
||||
{'indices_shape': [4, 1], 'indices_value': [4, 3, 1, 7], 'updates_dtype': bool, 'updates_shape': [4],
|
||||
'shape_shape': [1], 'shape_value': [8]},
|
||||
|
||||
{'indices_shape': [4, 2], 'indices_value': [[0, 0], [1, 0], [0, 2], [1, 2]], 'updates_dtype': np.int32,
|
||||
@ -22,7 +22,7 @@ test_params = [
|
||||
'updates_shape': [4, 5], 'shape_shape': [3], 'shape_value': [2, 3, 5]},
|
||||
{'indices_shape': [4, 2], 'indices_value': [[0, 0], [1, 0], [0, 2], [1, 2]], 'updates_dtype': np.float32,
|
||||
'updates_shape': [4, 5], 'shape_shape': [3], 'shape_value': [2, 3, 5]},
|
||||
{'indices_shape': [4, 2], 'indices_value': [[0, 0], [1, 0], [0, 2], [1, 2]], 'updates_dtype': np.bool,
|
||||
{'indices_shape': [4, 2], 'indices_value': [[0, 0], [1, 0], [0, 2], [1, 2]], 'updates_dtype': bool,
|
||||
'updates_shape': [4, 5], 'shape_shape': [3], 'shape_value': [2, 3, 5]},
|
||||
]
|
||||
|
||||
|
@ -13,7 +13,7 @@ test_params = [
|
||||
'begin_mask': 8, 'end_mask': 3, 'shrink_axis_mask': 4},
|
||||
{'shape': [12, 2, 2, 5], 'dtype': np.int64, 'strides': [1], 'begin': [0], 'end': [1],
|
||||
'begin_mask': 8, 'end_mask': 3, 'shrink_axis_mask': None},
|
||||
{'shape': [12, 2, 2, 5], 'dtype': np.bool, 'strides': [1], 'begin': [0], 'end': [1],
|
||||
{'shape': [12, 2, 2, 5], 'dtype': bool, 'strides': [1], 'begin': [0], 'end': [1],
|
||||
'begin_mask': 8, 'end_mask': 3, 'shrink_axis_mask': None},
|
||||
]
|
||||
|
||||
@ -24,7 +24,7 @@ class TestTFLiteStridedSliceLayerTest(TFLiteLayerTest):
|
||||
allowed_ops = ['STRIDED_SLICE']
|
||||
|
||||
def _prepare_input(self, inputs_dict, generator=None):
|
||||
if self.input_dtype == np.bool:
|
||||
if self.input_dtype == bool:
|
||||
inputs_dict['Input'] = np.random.choice([True, False], size=inputs_dict['Input'])
|
||||
else:
|
||||
inputs_dict['Input'] = np.random.randint(-255, 255, inputs_dict['Input']).astype(self.input_dtype)
|
||||
|
Loading…
Reference in New Issue
Block a user