diff --git a/benchmarks/124_minus_x.py b/benchmarks/124_minus_x.py index 6ce40b321..0a8717073 100644 --- a/benchmarks/124_minus_x.py +++ b/benchmarks/124_minus_x.py @@ -18,7 +18,7 @@ def main(): engine = hnp.compile_numpy_function( function_to_compile, {"x": x}, - [(i,) for i in range(2 ** 3)], + range(2 ** 3), compilation_configuration=BENCHMARK_CONFIGURATION, ) # bench: Measure: End diff --git a/benchmarks/124_minus_x_tensor.py b/benchmarks/124_minus_x_tensor.py index a311faa3f..c635edf23 100644 --- a/benchmarks/124_minus_x_tensor.py +++ b/benchmarks/124_minus_x_tensor.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(6), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 6, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 6, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/c_concatenate_x.py b/benchmarks/c_concatenate_x.py index da54411b1..a45662077 100644 --- a/benchmarks/c_concatenate_x.py +++ b/benchmarks/c_concatenate_x.py @@ -13,7 +13,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(4, 5)) c = np.arange(20).reshape((4, 5)) - inputset = [(np.random.randint(0, 2 ** 3, size=(4, 5)),) for _ in range(128)] + inputset = [np.random.randint(0, 2 ** 3, size=(4, 5)) for _ in range(128)] inputs = [] labels = [] diff --git a/benchmarks/c_matmul_x.py b/benchmarks/c_matmul_x.py index 6509c46d0..b553e7228 100644 --- a/benchmarks/c_matmul_x.py +++ b/benchmarks/c_matmul_x.py @@ -14,7 +14,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(2), shape=(2, 3)) - inputset = [(np.random.randint(0, 2 ** 2, size=(2, 3)),) for _ in range(128)] + inputset = [np.random.randint(0, 2 ** 2, size=(2, 3)) for _ in range(128)] inputs = [] labels = [] diff --git a/benchmarks/linear_regression.py b/benchmarks/linear_regression.py index 5419cf562..2820c4544 100644 --- a/benchmarks/linear_regression.py +++ b/benchmarks/linear_regression.py @@ -168,9 +168,7 @@ def main(): def function_to_compile(x_0): return table[(x_0 + zp_x) * w_0] - inputset = [] - for x_i in x_q: - inputset.append((int(x_i[0]),)) + inputset = [int(x_i[0]) for x_i in x_q] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/logistic_regression.py b/benchmarks/logistic_regression.py index 805f8f783..490990e1e 100644 --- a/benchmarks/logistic_regression.py +++ b/benchmarks/logistic_regression.py @@ -240,9 +240,7 @@ def main(): def function_to_compile(x_0, x_1): return table[((x_0 + zp_x) * w_0) + ((x_1 + zp_x) * w_1)] - inputset = [] - for x_i in x_q: - inputset.append((int(x_i[0]), int(x_i[1]))) + inputset = [(int(x_i[0]), int(x_i[1])) for x_i in x_q] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-index-0-and-0.py b/benchmarks/x-index-0-and-0.py index 98d664fb7..0fd5aab22 100644 --- a/benchmarks/x-index-0-and-0.py +++ b/benchmarks/x-index-0-and-0.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3, 2)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3, 2)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3, 2)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-index-0.py b/benchmarks/x-index-0.py index ce05272f3..7d9fd5787 100644 --- a/benchmarks/x-index-0.py +++ b/benchmarks/x-index-0.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-index-1.py b/benchmarks/x-index-1.py index 14a71af7f..bd9b35dea 100644 --- a/benchmarks/x-index-1.py +++ b/benchmarks/x-index-1.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-index-colon-2.py b/benchmarks/x-index-colon-2.py index 632e868a0..d9e3bae70 100644 --- a/benchmarks/x-index-colon-2.py +++ b/benchmarks/x-index-colon-2.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-index-colon-and-1.py b/benchmarks/x-index-colon-and-1.py index a938cddc2..e938e93be 100644 --- a/benchmarks/x-index-colon-and-1.py +++ b/benchmarks/x-index-colon-and-1.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3, 2)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3, 2)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3, 2)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-index-colon.py b/benchmarks/x-index-colon.py index 24a553bb3..a609c6731 100644 --- a/benchmarks/x-index-colon.py +++ b/benchmarks/x-index-colon.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-index-minus-1.py b/benchmarks/x-index-minus-1.py index 005a5db90..dd11ab589 100644 --- a/benchmarks/x-index-minus-1.py +++ b/benchmarks/x-index-minus-1.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-index-one-colon.py b/benchmarks/x-index-one-colon.py index 608480c92..7b18f832d 100644 --- a/benchmarks/x-index-one-colon.py +++ b/benchmarks/x-index-one-colon.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x-reversed.py b/benchmarks/x-reversed.py index 7d49199b6..111767ffa 100644 --- a/benchmarks/x-reversed.py +++ b/benchmarks/x-reversed.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_concatenate_c.py b/benchmarks/x_concatenate_c.py index 2c1b18973..845c790ee 100644 --- a/benchmarks/x_concatenate_c.py +++ b/benchmarks/x_concatenate_c.py @@ -13,7 +13,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(4, 5)) c = np.arange(20).reshape((4, 5)) - inputset = [(np.random.randint(0, 2 ** 3, size=(4, 5)),) for _ in range(128)] + inputset = [np.random.randint(0, 2 ** 3, size=(4, 5)) for _ in range(128)] inputs = [] labels = [] diff --git a/benchmarks/x_matmul_c.py b/benchmarks/x_matmul_c.py index c05a2bf18..524d8dcb7 100644 --- a/benchmarks/x_matmul_c.py +++ b/benchmarks/x_matmul_c.py @@ -14,7 +14,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(2), shape=(2, 3)) - inputset = [(np.random.randint(0, 2 ** 2, size=(2, 3)),) for _ in range(128)] + inputset = [np.random.randint(0, 2 ** 2, size=(2, 3)) for _ in range(128)] inputs = [] labels = [] diff --git a/benchmarks/x_minus_1_2_3.py b/benchmarks/x_minus_1_2_3.py index feaa5fb7e..d5da7b87d 100644 --- a/benchmarks/x_minus_1_2_3.py +++ b/benchmarks/x_minus_1_2_3.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 2, size=(3,)) + np.array([1, 2, 3]),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 2, size=(3,)) + np.array([1, 2, 3]) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_minus_1_2_3_broadcasted.py b/benchmarks/x_minus_1_2_3_broadcasted.py index 76f26c10f..05321904b 100644 --- a/benchmarks/x_minus_1_2_3_broadcasted.py +++ b/benchmarks/x_minus_1_2_3_broadcasted.py @@ -12,9 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(2, 3)) - inputset = [ - (np.random.randint(0, 2 ** 2, size=(2, 3)) + np.array([1, 2, 3]),) for _ in range(32) - ] + inputset = [np.random.randint(0, 2 ** 2, size=(2, 3)) + np.array([1, 2, 3]) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_minus_24_tensor.py b/benchmarks/x_minus_24_tensor.py index 0dbdcb546..ec6f09e32 100644 --- a/benchmarks/x_minus_24_tensor.py +++ b/benchmarks/x_minus_24_tensor.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(6), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 5, size=(3,)) + 24,) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 5, size=(3,)) + 24 for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_negative.py b/benchmarks/x_negative.py index c03a66135..59dbe1b2e 100644 --- a/benchmarks/x_negative.py +++ b/benchmarks/x_negative.py @@ -13,7 +13,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(10, 6)) - inputset = [(np.random.randint(0, 2 ** 3, size=(10, 6)),) for _ in range(128)] + inputset = [np.random.randint(0, 2 ** 3, size=(10, 6)) for _ in range(128)] inputs = [] labels = [] diff --git a/benchmarks/x_plus_1_2_3.py b/benchmarks/x_plus_1_2_3.py index 79ac21bc1..cec04ecae 100644 --- a/benchmarks/x_plus_1_2_3.py +++ b/benchmarks/x_plus_1_2_3.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_plus_1_2_3_broadcasted.py b/benchmarks/x_plus_1_2_3_broadcasted.py index be5178a80..f1b499ccb 100644 --- a/benchmarks/x_plus_1_2_3_broadcasted.py +++ b/benchmarks/x_plus_1_2_3_broadcasted.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(2, 3)) - inputset = [(np.random.randint(0, 2 ** 3, size=(2, 3)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(2, 3)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_plus_42_tensor.py b/benchmarks/x_plus_42_tensor.py index f697e0273..cdef398fc 100644 --- a/benchmarks/x_plus_42_tensor.py +++ b/benchmarks/x_plus_42_tensor.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_reshape.py b/benchmarks/x_reshape.py index 371c8aed0..401766162 100644 --- a/benchmarks/x_reshape.py +++ b/benchmarks/x_reshape.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(10, 6)) - inputset = [(np.random.randint(0, 2 ** 3, size=(10, 6)),) for _ in range(128)] + inputset = [np.random.randint(0, 2 ** 3, size=(10, 6)) for _ in range(128)] inputs = [] labels = [] diff --git a/benchmarks/x_times_1_2_3.py b/benchmarks/x_times_1_2_3.py index 70b88e82e..a141212c3 100644 --- a/benchmarks/x_times_1_2_3.py +++ b/benchmarks/x_times_1_2_3.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_times_1_2_3_broadcasted.py b/benchmarks/x_times_1_2_3_broadcasted.py index 34caf542c..136a7aa10 100644 --- a/benchmarks/x_times_1_2_3_broadcasted.py +++ b/benchmarks/x_times_1_2_3_broadcasted.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(2, 3)) - inputset = [(np.random.randint(0, 2 ** 3, size=(2, 3)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(2, 3)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_times_7_tensor.py b/benchmarks/x_times_7_tensor.py index 75ca326d0..199db6226 100644 --- a/benchmarks/x_times_7_tensor.py +++ b/benchmarks/x_times_7_tensor.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(3,)) - inputset = [(np.random.randint(0, 2 ** 3, size=(3,)),) for _ in range(32)] + inputset = [np.random.randint(0, 2 ** 3, size=(3,)) for _ in range(32)] # bench: Measure: Compilation Time (ms) engine = hnp.compile_numpy_function( diff --git a/benchmarks/x_tranpose.py b/benchmarks/x_tranpose.py index b01b84177..b579d7966 100644 --- a/benchmarks/x_tranpose.py +++ b/benchmarks/x_tranpose.py @@ -12,7 +12,7 @@ def main(): x = hnp.EncryptedTensor(hnp.UnsignedInteger(3), shape=(2, 4)) - inputset = [(np.random.randint(0, 2 ** 3, size=(2, 4)),) for _ in range(128)] + inputset = [np.random.randint(0, 2 ** 3, size=(2, 4)) for _ in range(128)] inputs = [] labels = []