class_docstr: Interface to concatenate data and transfer them to GPU asynchronously.
  
  It enables to transfer next batch of input data to GPU while GPU is
  running kernels for training using current batch of input data.
  
  An instance of this class is mainly intended to be used as a converter
  function of an updater like below.
  
  .. doctest::
  
      from chainer.dataset import convert
      ...
      updater = chainer.training.updaters.StandardUpdater(
                     ...,
                     converter=convert.ConcatWithAsyncTransfer(),
                     ...)
  
  Args:
      stream (cupy.cuda.Stream): CUDA stream. If ``None``, a stream is
          automatically created on the first call. Data transfer operation
          is launched asynchronously using the stream.
      compute_stream(cupy.cuda.Stream): CUDA stream used for compute kernels.
          If not ``None``, CUDA events are created/used to avoid global
          synchronization and overlap execution of compute kernels and data
          transfers as much as possible. If ``None``, global synchronization
          is used instead.
class_docstr_tok: ["Interface","to","concatenate","data","and","transfer","them","to","GPU","asynchronously",".","It","enables","to","transfer","next","batch","of","input","data","to","GPU","while","GPU","is","running","kernels","for","training","using","current","batch","of","input","data",".","An","instance","of","this","class","is","mainly","intended","to","be","used","as","a","converter","function","of","an","updater","like","below",".","..","doctest",":",":","from","chainer.dataset","import","convert","...","updater","=","chainer.training.updaters.StandardUpdater","(","...",",","converter=convert.ConcatWithAsyncTransfer","(",")",",","...",")","Args",":","stream","(","cupy.cuda.Stream",")",":","CUDA","stream",".","If","``","None","``",",","a","stream","is","automatically","created","on","the","first","call",".","Data","transfer","operation","is","launched","asynchronously","using","the","stream",".","compute_stream","(","cupy.cuda.Stream",")",":","CUDA","stream","used","for","compute","kernels",".","If","not","``","None","``",",","CUDA","events","are","created\/used","to","avoid","global","synchronization","and","overlap","execution","of","compute","kernels","and","data","transfers","as","much","as","possible",".","If","``","None","``",",","global","synchronization","is","used","instead","."]
code: def __init__(self, stream=None, compute_stream=None):
      self._stream = stream
      self.compute_stream = compute_stream
  
      self._device = None
      self._conveyor = collections.defaultdict(self._get_conveyor)
      if compute_stream is not None:
          # * event1 prevents a CPU thread to update arrays that might be
          #   still being used by GPU kernels.
          # * event2 prevents a GPU kernel to read arrays that might be
          #   still being transferred to GPU.
          self._event1 = cuda.Event()
          self._event2 = cuda.Event()
          self._sync_get = False
      else:
          self._sync_get = True
  
imports: import collections
  import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
label_desc: Use image node_id 1 to create a new ConcatWithAsyncTransfer object from inherited base classes: object with example: obj = ConcatWithAsyncTransfer(stream, compute_stream)