A scalable, configurable neural network accelerator supporting on-device training