def ndarray_print(nd):
 try:
  x = nd.tolist()
 except (TypeError, NotImplementedError):
  x = nd.tobytes()
 if isinstance(nd, ndarray):
  offset = nd.offset
  flags = nd.flags
 else:
  offset = 'unknown'
  flags = 'unknown'
 print ("ndarray(%s, shape=%s, strides=%s, suboffsets=%s, offset=%s, format='%s', itemsize=%s, flags=%s)" % (x, nd.shape, nd.strides, nd.suboffsets, offset, nd.format, nd.itemsize, flags))
 sys.stdout.flush()

def ndarray_print ( nd ) : try : x = nd . tolist ( ) except ( TypeError , NotImplementedError ) : x = nd . tobytes ( ) if isinstance ( nd , ndarray ) : offset = nd . offset flags = nd . flags else : offset = 'unknown' flags = 'unknown' print ( "ndarray(%s, shape=%s, strides=%s, suboffsets=%s, offset=%s, format='%s', itemsize=%s, flags=%s)" % ( x , nd . shape , nd . strides , nd . suboffsets , offset , nd . format , nd . itemsize , flags ) ) sys . stdout . flush ( )
print ndarray for debugging .