Saving backpropagation for-loop implementation separately