Dynamic Spatial Sparsification for Efficient Vision Transformers and Convolutional Neural Networks