@@ -59,7 +59,7 @@ def __init__(self, array_like: ArrayLike) -> None:
5959
6060 if array_like .ndim != 1 :
6161 raise ValueError ("array_like: only 1-dim allowed" )
62- if array_like .dtype != np .dtype ("b " ):
62+ if array_like .dtype != np .dtype ("B " ):
6363 raise ValueError ("array_like: only byte dtype allowed" )
6464
6565 if not hasattr (array_like , "__cuda_array_interface__" ):
@@ -84,7 +84,7 @@ def create_zero_length(cls) -> Self:
8484 -------
8585 New empty 0-length buffer
8686 """
87- return cls (cp .array ([], dtype = "b " ))
87+ return cls (cp .array ([], dtype = "B " ))
8888
8989 @classmethod
9090 def from_buffer (cls , buffer : core .Buffer ) -> Self :
@@ -100,14 +100,14 @@ def from_buffer(cls, buffer: core.Buffer) -> Self:
100100
101101 @classmethod
102102 def from_bytes (cls , bytes_like : BytesLike ) -> Self :
103- return cls .from_array_like (cp .frombuffer (bytes_like , dtype = "b " ))
103+ return cls .from_array_like (cp .frombuffer (bytes_like , dtype = "B " ))
104104
105105 def as_numpy_array (self ) -> npt .NDArray [Any ]:
106106 return cast (npt .NDArray [Any ], cp .asnumpy (self ._data ))
107107
108108 def __add__ (self , other : core .Buffer ) -> Self :
109109 other_array = other .as_array_like ()
110- assert other_array .dtype == np .dtype ("b " )
110+ assert other_array .dtype == np .dtype ("B " )
111111 gpu_other = Buffer (other_array )
112112 gpu_other_array = gpu_other .as_array_like ()
113113 return self .__class__ (
@@ -129,7 +129,7 @@ class NDBuffer(core.NDBuffer):
129129 Notes
130130 -----
131131 The two buffer classes Buffer and NDBuffer are very similar. In fact, Buffer
132- is a special case of NDBuffer where dim=1, stride=1, and dtype="b ". However,
132+ is a special case of NDBuffer where dim=1, stride=1, and dtype="B ". However,
133133 in order to use Python's type system to differentiate between the contiguous
134134 Buffer and the n-dim (non-contiguous) NDBuffer, we keep the definition of the
135135 two classes separate.
0 commit comments