Add comment explaining purpose of the accumulate_grad argument (#47266)

Summary:
Addressing a comment from a PR that has already been merged https://github.com/pytorch/pytorch/issues/46855

https://github.com/pytorch/pytorch/pull/46855#discussion_r515161953

Pull Request resolved: https://github.com/pytorch/pytorch/pull/47266

Reviewed By: agolynski

Differential Revision: D24709017

Pulled By: soulitzer

fbshipit-source-id: 3c104c2fef90ffd75951ecef4ae9e938d4b12d8c
This commit is contained in:
Jeffrey Wan
2020-11-03 13:14:20 -08:00
committed by Facebook GitHub Bot
parent dc0d68a1ee
commit ea93bdc212

View File

@ -129,7 +129,7 @@ PyObject *THPEngine_run_backward(PyObject *self, PyObject *args, PyObject *kwarg
unsigned char create_graph = 0;
PyObject *inputs = nullptr;
unsigned char allow_unreachable = 0;
unsigned char accumulate_grad = 0;
unsigned char accumulate_grad = 0; // Indicate whether to accumulate grad into leaf Tensors or capture
const char *accepted_kwargs[] = { // NOLINT
"tensors", "grad_tensors", "keep_graph", "create_graph", "inputs",
"allow_unreachable", "accumulate_grad", nullptr