From 984fe4853d04224d2e88ff10f2bc08b38ef4d025 Mon Sep 17 00:00:00 2001 From: Tai Ly Date: Wed, 15 Nov 2023 23:06:19 +0000 Subject: [reference_model] add local_bound attribute to test_gen Signed-off-by: Tai Ly Change-Id: I9b87d1ad0f09648d07a6ecfc2075a174a9d04a3d --- verif/generator/tosa_test_gen.py | 51 +++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/verif/generator/tosa_test_gen.py b/verif/generator/tosa_test_gen.py index 3014c81..3f6c96f 100644 --- a/verif/generator/tosa_test_gen.py +++ b/verif/generator/tosa_test_gen.py @@ -713,8 +713,11 @@ class TosaTestGen: ): return None + # TODO - Test local_bound, for now set local bound attribute to False + local_bound = False + attr = ts.TosaSerializerAttribute() - attr.ConvAttribute(padding, strides, dilations, qinfo[0], qinfo[1]) + attr.ConvAttribute(padding, strides, dilations, qinfo[0], qinfo[1], local_bound) self.ser.addOperator(op["op"], input_list, output_list, attr) return result_tens @@ -785,8 +788,11 @@ class TosaTestGen: ): return None + # TODO - Test local_bound, for now set local bound attribute to False + local_bound = False + attr = ts.TosaSerializerAttribute() - attr.ConvAttribute(padding, strides, dilations, qinfo[0], qinfo[1]) + attr.ConvAttribute(padding, strides, dilations, qinfo[0], qinfo[1], local_bound) self.ser.addOperator(op["op"], input_list, output_list, attr) return result_tens @@ -848,8 +854,13 @@ class TosaTestGen: ): return None + # TODO - Test local_bound, for now set local bound attribute to False + local_bound = False + attr = ts.TosaSerializerAttribute() - attr.TransposeConvAttribute(out_pad, stride, output_shape, qinfo[0], qinfo[1]) + attr.TransposeConvAttribute( + out_pad, stride, output_shape, qinfo[0], qinfo[1], local_bound + ) self.ser.addOperator(op["op"], input_list, output_list, attr) return result_tens @@ -919,8 +930,11 @@ class TosaTestGen: ): return None + # TODO - Test local_bound, for now set local bound attribute to False + local_bound = False + attr = ts.TosaSerializerAttribute() - attr.ConvAttribute(padding, strides, dilations, qinfo[0], qinfo[1]) + attr.ConvAttribute(padding, strides, dilations, qinfo[0], qinfo[1], local_bound) self.ser.addOperator(op["op"], input_list, output_list, attr) return result_tens @@ -2184,7 +2198,13 @@ class TosaTestGen: return acc_out def build_fft2d( - self, op, val1, val2, inverse, validator_fcns=None, error_name=None + self, + op, + val1, + val2, + inverse, + validator_fcns=None, + error_name=None, ): results = OutputShaper.fft2dOp(self.ser, self.rng, val1, val2, error_name) @@ -2219,13 +2239,22 @@ class TosaTestGen: ): return None + # TODO - Test local_bound, for now set local bound attribute to False + local_bound = False + attr = ts.TosaSerializerAttribute() - attr.FFTAttribute(inverse) + attr.FFTAttribute(inverse, local_bound) self.ser.addOperator(op["op"], input_names, output_names, attr) return results - def build_rfft2d(self, op, val, validator_fcns=None, error_name=None): + def build_rfft2d( + self, + op, + val, + validator_fcns=None, + error_name=None, + ): results = OutputShaper.rfft2dOp(self.ser, self.rng, val, error_name) input_names = [val.name] @@ -2256,7 +2285,13 @@ class TosaTestGen: ): return None - self.ser.addOperator(op["op"], input_names, output_names) + # TODO - Test local_bound, for now set local bound attribute to False + local_bound = False + + attr = ts.TosaSerializerAttribute() + attr.RFFTAttribute(local_bound) + + self.ser.addOperator(op["op"], input_names, output_names, attr) return results def create_filter_lists( -- cgit v1.2.1