braindecode.functional.pad_or_crop_to_patches#

braindecode.functional.pad_or_crop_to_patches(x, patch_size, on_non_divisible='pad', step=0, min_patches=1, center=False)[source]#

Right zero-pad or crop the last axis so the patches tile it.

A tiled axis is returned as is. An axis short of min_patches patches is zero-padded up to that many, with half the missing ones (whole steps) before it if center.

Parameters:
Returns:

Shape (..., patch_size + (n_patches - 1) * step).

Return type:

Tensor