Skip to content

Commit

Permalink
add clarifying comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesGaessler committed Sep 15, 2024
1 parent bde1131 commit 7b90357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/mnist/mnist-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ void mnist_model_train(mnist_model & model, const float * images, const float *
ggml_backend_graph_compute(model.backend, gb_grad);
} else {
// For the last iteration, calculate gradients and also apply the optimizer:
ggml_backend_graph_compute(model.backend, gb_opt);
ggml_backend_graph_compute(model.backend, gb_opt); // gb_opt contains all nodes of gb_grad so no extra call for gb_grad is needed.
ggml_graph_reset(gb_grad); // Set gradients to zero, do not reset optimizer.
}

Expand Down

0 comments on commit 7b90357

Please sign in to comment.