:py:mod:`tonic.collation`
=========================

.. py:module:: tonic.collation


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   tonic.collation.PadTensors




.. py:class:: PadTensors(batch_first: bool = True)


   This is a custom collate function for a pytorch dataloader to load multiple event recordings
   at once. It's intended to be used in combination with sparse tensors. All tensor sizes are
   extended to the largest one in the batch, i.e. the longest recording.

   .. rubric:: Example

   >>> dataloader = torch.utils.data.DataLoader(dataset,
   >>>                                          batch_size=10,
   >>>                                          collate_fn=tonic.collation.PadTensors(),
   >>>                                          shuffle=True)

   .. py:method:: __call__(batch)



