Partially revert "Fix astype from boolean"
This partially reverts commit
@@ -504,14 +504,6 @@ cdef class ndarray:
'Casting complex values to real discards the imaginary part',
numpy.ComplexWarning)
elementwise_copy(self.real, newarray)
- elif self.dtype.kind == 'b':
- # See #4354. The result of `astype` from a ndarray whose dtype is
- # boolean to another dtype is expected to be zero or one. However,
- # its underlying representation is not necessarily zero or one
- # (i.g. a view). In such a case,`elementwise_copy` copies the data
- # as it is, resulting in an undesirable output. To keep it off, we
- # give a special path for a boolean ndarray.
- cupy.not_equal(self, 0, out=newarray)
else:
elementwise_copy(self, newarray)
return newarray
