From 278226b55dbb71fadc196967f180ab84d85d2b9f Mon Sep 17 00:00:00 2001 From: Yaman Umuroglu <maltanar@gmail.com> Date: Thu, 14 May 2020 22:45:46 +0100 Subject: [PATCH] [Test] small comment and changes in multithreshold --- ...{test_multi_thresholding.py => test_multithreshold.py} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename tests/custom_op/{test_multi_thresholding.py => test_multithreshold.py} (97%) diff --git a/tests/custom_op/test_multi_thresholding.py b/tests/custom_op/test_multithreshold.py similarity index 97% rename from tests/custom_op/test_multi_thresholding.py rename to tests/custom_op/test_multithreshold.py index 5fc69ce50..7e6ad4fe0 100644 --- a/tests/custom_op/test_multi_thresholding.py +++ b/tests/custom_op/test_multithreshold.py @@ -40,7 +40,7 @@ def compare(x, y): else: return 0.0 - +# naive implementation of thresholding for performance comparison def multithreshold_elementwise(v, thresholds, out_scale=None, out_bias=None): """Given a set of threshold values t={t_0, t_1 ... t_n} the successive thresholding maps any real number x to an integer in the interval [0, n], @@ -96,7 +96,7 @@ def multithreshold_elementwise(v, thresholds, out_scale=None, out_bias=None): return out_scale * ret.reshape(v.shape) + out_bias -def test_execute_multi_thresholding(): +def test_multithreshold(): inputs = np.ndarray( shape=(6, 3, 2, 2), @@ -315,8 +315,8 @@ def test_execute_multi_thresholding(): if __name__ == "__main__": - vector_runtime, non_vector_runtime = test_execute_multi_thresholding() + vector_runtime, non_vector_runtime = test_multithreshold() - print("Runtime non vector: ", non_vector_runtime, "s") + print("Runtime non-vectorized: ", non_vector_runtime, "s") print("Runtime vectorized: ", vector_runtime, "s") print("Speed-up: ", non_vector_runtime / vector_runtime) -- GitLab