aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Johnson <jeremy.johnson@arm.com>2022-02-17 12:29:35 +0000
committerJeremy Johnson <jeremy.johnson@arm.com>2022-02-17 12:29:35 +0000
commitc0fe04d4105884b61b5eeca4c0a932846a77b6e2 (patch)
treed7c51a491dc44e2390a8a397223e80c38b906256
parent42c9bae449af7ee395fc0e52d4ca7cc9ad55edeb (diff)
downloadreference_model-c0fe04d4105884b61b5eeca4c0a932846a77b6e2.tar.gz
Fix rescale test gen for scale32 & dtype
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: I65a7fac6e65d2b979139adaf6c5a42139b5493c2
-rw-r--r--verif/generator/tosa_test_gen.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/verif/generator/tosa_test_gen.py b/verif/generator/tosa_test_gen.py
index e60e643..5f613f0 100644
--- a/verif/generator/tosa_test_gen.py
+++ b/verif/generator/tosa_test_gen.py
@@ -5146,17 +5146,17 @@ class TosaTestGen:
max_shift_value_arr[i] = (1 << (shift_arr[i] - 2)) - 1
# print('multiplier {} shift {} inzp {} outzp {}'.format(multiplier_arr, shift_arr, input_zp, output_zp))
- if error_name is None:
- # Make sure random values are within speicification
+ if scale32 and error_name is None:
+ # Make sure random values are within apply_scale_32 speicification
# REQUIRES(value >= (-1<<(shift-2)) && value < (1<<(shift-2))
assert val.placeholderFilename
values = np.load(
os.path.join(self.basePath, self.testPath, val.placeholderFilename)
)
- val_adj = np.subtract(values, input_zp)
- val_adj = np.maximum(val_adj, min_shift_value_arr, dtype=values.dtype)
- val_adj = np.minimum(val_adj, max_shift_value_arr, dtype=values.dtype)
- val_adj = np.add(val_adj, input_zp)
+ val_adj = np.subtract(values, input_zp, dtype=np.int64)
+ val_adj = np.maximum(val_adj, min_shift_value_arr, dtype=np.int64)
+ val_adj = np.minimum(val_adj, max_shift_value_arr, dtype=np.int64)
+ val_adj = np.add(val_adj, input_zp, dtype=values.dtype)
if not np.all(np.array_equal(values, val_adj)):
# Values changed so overwrite file with new values
np.save(