Here is example with unexpected behavior:
import dpctl, dpctl.tensor as dpt, numpy
dpctl.__version__
# Out: '0.21.0dev0+49.g5be8ef909c'
a = numpy.array([0, 3, 1, 2, 0, 1], dtype='u1')
a_view = a.view('?')
# create a view from numpy.ndarray
b = numpy.array(a_view)
b
# Out: array([False, True, True, True, False, True])
dpt_b = dpt.asarray(a_view)
dpt_b # the same as b
# Out: usm_ndarray([False, True, True, True, False, True])
# cast to integer dtype
numpy.astype(b, int)
# Out: array([0, 1, 1, 1, 0, 1])
# the result is unexpected, since True and False have to casted to 0 and 1 only
dpt.astype(dpt_b, int)
# Out: usm_ndarray([0, 3, 1, 2, 0, 1])