MIME: adapting a single neural network for multi-task inference with memory-efficient dynamic pruning