- tags
- Coding
Einops is a array manipulation paradigm that uses string description of the array operations to make complex manipulations (such as summing, broadcasting and reshaping on specific axes only) easier.
Examples
Max pooling
import einops as ein
patches = ein.rearrange(img, '(h i) (w j) c -> h w i j c', i=20, j=20)
max_pool = ein.reduce(patches, 'h w i j c -> h w c', 'max')