diff options
author | Eric Kunze <eric.kunze@arm.com> | 2022-06-30 21:37:09 +0000 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-07-11 16:03:34 -0700 |
commit | 750d27da447205ce82056d8b6b473e7a6ec051c6 (patch) | |
tree | 75ea3c566669f47e472c5c723b264a3eef872a87 /verif/generator/tosa_test_gen.py | |
parent | 4b85a0b0e6bf0d81a70a399d365b9ac2e74c29bc (diff) | |
download | reference_model-750d27da447205ce82056d8b6b473e7a6ec051c6.tar.gz |
Modify input limits for apply_scale_32
Aligns with change in specification, as the limit to value being between
(-1 << shift-2) and (1 << shift-2) was overly constraining.
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Change-Id: I72cc5743344d4036920c3df366e0a3930701a0cb
Diffstat (limited to 'verif/generator/tosa_test_gen.py')
-rw-r--r-- | verif/generator/tosa_test_gen.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/verif/generator/tosa_test_gen.py b/verif/generator/tosa_test_gen.py index b0e7c8c..583e1ed 100644 --- a/verif/generator/tosa_test_gen.py +++ b/verif/generator/tosa_test_gen.py @@ -1653,13 +1653,13 @@ class TosaTestGen: multiplier_arr[i], shift_arr[i] = TosaQuantGen.computeMultiplierAndShift( scale_arr[i], scale32 ) - min_shift_value_arr[i] = -1 << (shift_arr[i] - 2) - max_shift_value_arr[i] = (1 << (shift_arr[i] - 2)) - 1 + min_shift_value_arr[i] = -1 << (shift_arr[i] - 1) + max_shift_value_arr[i] = (1 << (shift_arr[i] - 1)) - 1 # print('multiplier {} shift {} inzp {} outzp {}'.format(multiplier_arr, shift_arr, input_zp, output_zp)) if scale32 and error_name is None: # Make sure random values are within apply_scale_32 specification - # REQUIRES(value >= (-1<<(shift-2)) && value < (1<<(shift-2)) + # REQUIRES(value >= (-1<<(shift-1)) && value < (1<<(shift-1)) assert val.placeholderFilename values = np.load( os.path.join(self.basePath, self.testPath, val.placeholderFilename) |