braindecode.functional.unpack_channels#

braindecode.functional.unpack_channels(x, ch_mask, n_chans)[source]#

Split the output of pack_channels() back into samples and channels.

Parameters:
  • x (Tensor) – Tensor of shape (n_real, ...), one row per real channel, in the order pack_channels() returns them.

  • ch_mask (Optional[Tensor]) – The boolean mask of shape (batch, n_chans) given to pack_channels(), or None.

  • n_chans (int) – Number of channels of the padded batch.

Returns:

Shape (batch, n_chans, ...), zeros for the padded channels.

Return type:

Tensor