def set_stream(self, stream=None): if stream is None: stream = cuda.Stream() curand.setStream(self._generator, stream.ptr)