* add bitwise operators * add build to requirements * [EDIT] - Tweaked test data and saved test results. * Tweaked test values for and / or * [EDIT] - Setting print options to be verbose for test comparisons. * [EDIT] - Removed call to set_printoptions and added output from ulab instead of numpy. Of note - there seems to be a discrepancy between the numpy and ulab output for one of the left_shift cases. * [EDIT] - Added newline at end of file for diffing purposes. * [EDIT] - Added print options back in as output seemed truncated. --------- Co-authored-by: Zoltán Vörös <zvoros@gmail.com> Co-authored-by: JamieDouugh <jamie.davies@douugh.com>
16 lines
373 B
Python
16 lines
373 B
Python
try:
|
|
from ulab import numpy as np
|
|
except:
|
|
import numpy as np
|
|
|
|
|
|
dtypes = (np.uint8, np.int8, np.uint16, np.int16)
|
|
test_values1 = (0, 1, 0, 1, 2, 5)
|
|
test_values2 = (0, 1, 1, 0, 2, 7)
|
|
|
|
|
|
for dtype1 in dtypes:
|
|
x1 = np.array(test_values1, dtype=dtype1)
|
|
for dtype2 in dtypes:
|
|
x2 = np.array(test_values2, dtype=dtype2)
|
|
print(np.bitwise_and(x1, x2))
|