Generating multi-purpose accelerators using neural networks