diff --git a/tests/python/unittest/test_numpy_interoperability.py b/tests/python/unittest/test_numpy_interoperability.py index 9097c25093b7..7195ca39dc43 100644 --- a/tests/python/unittest/test_numpy_interoperability.py +++ b/tests/python/unittest/test_numpy_interoperability.py @@ -53,9 +53,9 @@ def _prepare_workloads(): '1x1x0': np.array([[[]]]) } - dt_int = [np.int8, np.int32, np.int64, np.uint8] - dt_float = [np.float16, np.float32, np.float64] - dt = dt_int + dt_float + DT_INT = [np.int8, np.int32, np.int64, np.uint8] + DT_FLOAT = [np.float16, np.float32, np.float64] + DT = DT_INT + DT_FLOAT # workloads for array function protocol OpArgMngr.add_workload('argmax', np.random.uniform(size=(4, 5, 6, 7, 8)), 0) @@ -106,7 +106,7 @@ def _prepare_workloads(): OpArgMngr.add_workload('concatenate', [array_pool['4x1'], array_pool['4x1']], axis=1) OpArgMngr.add_workload('copy', array_pool['4x1']) - for ctype in dt: + for ctype in DT: OpArgMngr.add_workload('cumsum', np.array([1, 2, 10, 11, 6, 5, 4], dtype=ctype)) OpArgMngr.add_workload('cumsum', np.array([[1, 2, 3, 4], [5, 6, 7, 9], [10, 3, 4, 5]], dtype=ctype), axis=0) OpArgMngr.add_workload('cumsum', np.array([[1, 2, 3, 4], [5, 6, 7, 9], [10, 3, 4, 5]], dtype=ctype), axis=1) @@ -375,7 +375,7 @@ def _signs(dt): else: return (+1, -1) - for ct in dt: + for ct in DT: for sg1, sg2 in itertools.product(_signs(ct), _signs(ct)): a = np.array(sg1*71, dtype=ct) b = np.array(sg2*19, dtype=ct) @@ -397,7 +397,7 @@ def _signs(dt): OpArgMngr.add_workload('remainder', fa, fb) # test_float_remainder_roundoff - for ct in dt_float: + for ct in DT_FLOAT: for sg1, sg2 in itertools.product((+1, -1), (+1, -1)): a = np.array(sg1*78*6e-8, dtype=ct) b = np.array(sg2*6e-8, dtype=ct) @@ -405,7 +405,7 @@ def _signs(dt): # test_float_remainder_corner_cases # Check remainder magnitude. - for ct in dt_float: + for ct in DT_FLOAT: b = _np.array(1.0) a = np.array(_np.nextafter(_np.array(0.0), -b), dtype=ct) b = np.array(b, dtype=ct)