Learning an adaptive sparse transformer for efficient image restoration