Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
change variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
hgt312 committed Oct 18, 2019
1 parent 822f77a commit ad09536
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/python/unittest/test_numpy_interoperability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -365,7 +365,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)
Expand All @@ -387,15 +387,15 @@ 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)
OpArgMngr.add_workload('remainder', a, b)

# 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)
Expand Down

0 comments on commit ad09536

Please sign in to comment.