def _mat_ptrs(a):
 if (len(a) == 1):
  return cuda.cupy.full((1,), a.data.ptr, dtype=numpy.uintp)
 else:
  stride = a.strides[0]
  ptr = a.data.ptr
  return cuda.cupy.arange(ptr, (ptr + (stride * len(a))), stride, dtype=numpy.uintp)

def _mat_ptrs ( a ) : if ( len ( a ) == 1 ) : return cuda . cupy . full ( ( 1 , ) , a . data . ptr , dtype = numpy . uintp ) else : stride = a . strides [ 0 ] ptr = a . data . ptr return cuda . cupy . arange ( ptr , ( ptr + ( stride * len ( a ) ) ) , stride , dtype = numpy . uintp )
creates an array of pointers to matrices args: a: a batch of matrices on gpu .