Skip to content

Commit da02b34

Browse files
committed
ENH: add simple str and repr to gpuarray
1 parent 1a45e05 commit da02b34

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎pygpu/gpuarray.pyx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,13 @@ cdef class GpuArray:
18281828
# structure.
18291829
return <size_t>((<void **>self.ga.data)[0])
18301830

1831+
def __str__(self):
1832+
return str(numpy.asarray(self))
1833+
1834+
def __repr__(self):
1835+
return 'gpuarray.' + repr(numpy.asarray(self))
1836+
1837+
18311838

18321839
cdef class GpuKernel:
18331840
"""

0 commit comments

Comments
 (0)