def empty_like(x): if cuda.available and isinstance(x, cuda.ndarray): return cuda.cupy.empty_like(x) else: return numpy.empty_like(x)