benchmark/code/recnn/model/dataset.py
def customized_collate(batch):
  """"
  default_collate contains definitions of the methods used by the _DataLoaderIter workers to collate samples fetched from dataset into Tensor(s).
  These **needs** to be in global scope since Py2 doesn't support serializing
  static methods.
  Here we define customized_collate that returns the elements of each batch tuple shifted to pytorch tensors.
  """

  levels=torch.LongTensor(batch[0][0])
  children=torch.LongTensor(batch[0][1])
  n_inners=torch.LongTensor(batch[0][2])
  contents = torch.FloatTensor(batch[0][3])
  n_level=torch.LongTensor(batch[0][4])
  labels= torch.LongTensor(batch[0][5])

  return levels, children, n_inners, contents, n_level, labels

  default_collate contains definitions of the methods used by the _DataLoaderIter workers to collate samples fetched from dataset into Tensor(s).
  These **needs** to be in global scope since Py2 doesn't support serializing
  static methods.
  Here we define customized_collate that returns the elements of each batch tuple shifted to pytorch tensors.
  
default_collate contains definitions of the methods used by the _DataLoaderIter workers to collate samples fetched from dataset into Tensor(s).
These **needs** to be in global scope since Py2 doesn't support serializing
static methods.
Here we define customized_collate that returns the elements of each batch tuple shifted to pytorch tensors.
default_collate contains definitions of the methods used by the _DataLoaderIter workers to collate samples fetched from dataset into Tensor ( s ) . These ** needs ** to be in global scope since Py2 doesn ' t support serializing static methods . Here we define customized_collate that returns the elements of each batch tuple shifted to pytorch tensors .
def customized_collate(batch):
  levels=torch.LongTensor(batch[0][0])
  children=torch.LongTensor(batch[0][1])
  n_inners=torch.LongTensor(batch[0][2])
  contents = torch.FloatTensor(batch[0][3])
  n_level=torch.LongTensor(batch[0][4])
  labels= torch.LongTensor(batch[0][5])
  return levels, children, n_inners, contents, n_level, labels
def customized_collate ( batch ) : levels = torch . LongTensor ( batch [ 0 ] [ 0 ] ) children = torch . LongTensor ( batch [ 0 ] [ 1 ] ) n_inners = torch . LongTensor ( batch [ 0 ] [ 2 ] ) contents = torch . FloatTensor ( batch [ 0 ] [ 3 ] ) n_level = torch . LongTensor ( batch [ 0 ] [ 4 ] ) labels = torch . LongTensor ( batch [ 0 ] [ 5 ] ) return levels , children , n_inners , contents , n_level , labels
default_collate contains definitions of the methods used by the _DataLoaderIter workers to collate samples fetched from dataset into Tensor(s).
default_collate contains definitions of the methods used by the _DataLoaderIter workers to collate samples fetched from dataset into Tensor ( s ) .
""""
  default_collate contains definitions of the methods used by the _DataLoaderIter workers to collate samples fetched from dataset into Tensor(s).
  These **needs** to be in global scope since Py2 doesn't support serializing
  static methods.
  Here we define customized_collate that returns the elements of each batch tuple shifted to pytorch tensors.
  """
batch