braindecode.functional.check_ch_mask#

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

Validate the channel mask of a padded batch.

Parameters:
  • ch_mask (Optional[Tensor]) – Mask of shape (batch, n_chans), True for real channels and False for padding.

  • x (Tensor) – Input of shape (batch, n_chans, ...) the mask describes.

Returns:

ch_mask as a boolean tensor on the device of x, or None. Every sample must have a real channel, which is checked in eager mode only.

Return type:

Optional[Tensor]