mindscience.common.patchify

mindscience.common.patchify(label, patch_size=16)[source]

Convert an image-like tensor into a sequence of flattened patches.

Parameters
  • label (Union[int, float]) – output dimension for each position.

  • patch_size (int, optional) – The patch size of image. Default: 16.

Returns

Numpy.array, the array with new shape of (H, W).