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_patchespatches is zero-padded up to that many, with half the missing ones (whole steps) before it ifcenter.- Parameters:
x (
Tensor) – Shape(..., n_times).patch_size (
int) – As inpatch_count().on_non_divisible (
str) – As inpatch_count().step (
int) – As inpatch_count().min_patches (
int) – Least number of patches on the returned axis.center (
bool) – Pad half the missing patches on the left.
- Returns:
Shape
(..., patch_size + (n_patches - 1) * step).- Return type: