class_docstr: Custom Converter.
  
  Args:
      subsampling_factor (int): The subsampling factor.
docstr: Perform subsampling.
  
  Args:
      batch (list): Batch that will be sabsampled.
      device (chainer.backend.Device): CPU or GPU device.
  
  Returns:
      chainer.Variable: xp.array that are padded and subsampled from batch.
      xp.array: xp.array of the length of the mini-batches.
      chainer.Variable: xp.array that are padded and subsampled from batch.
docstr_tok: ["Perform","subsampling",".","Args",":","batch","(","list",")",":","Batch","that","will","be","sabsampled",".","device","(","chainer.backend.Device",")",":","CPU","or","GPU","device",".","Returns",":","chainer.Variable",":","xp.array","that","are","padded","and","subsampled","from","batch",".","xp.array",":","xp.array","of","the","length","of","the","mini-batches",".","chainer.Variable",":","xp.array","that","are","padded","and","subsampled","from","batch","."]
code: def __call__(self, batch, device):
      """Perform subsampling.
  
      Args:
          batch (list): Batch that will be sabsampled.
          device (chainer.backend.Device): CPU or GPU device.
  
      Returns:
          chainer.Variable: xp.array that are padded and subsampled from batch.
          xp.array: xp.array of the length of the mini-batches.
          chainer.Variable: xp.array that are padded and subsampled from batch.
  
      """
      # For transformer, data is processed in CPU.
      # batch should be located in list
      assert len(batch) == 1
      xs, ys = batch[0]
      xs = F.pad_sequence(xs, padding=-1).data
      # get batch of lengths of input sequences
      ilens = np.array([x.shape[0] for x in xs], dtype=np.int32)
      return xs, ilens, ys
  
imports: import collections
  import logging
  import math
  import numpy
  from chainer import cuda
  from chainer import functions
  from chainer import training
  from chainer.training import extension
  from chainer.training.updaters.multiprocess_parallel_updater import gather_grads, gather_params, scatter_grads
label_desc: Use image node_id 2 for calling the CustomConverter obj's underlying member method code with example usage: obj.__call__(batch, device) and returns: xs,  ilens,  ys