* improve performance set one thread for NN replace detach() op with torch.no_grad() * fix pep 8 errors