Update argument names of torch::autograd::FunctionPostHook (#18140)
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 29 Mar 2019 23:15:10 +0000 (16:15 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 29 Mar 2019 23:30:23 +0000 (16:30 -0700)
commit47e27723203e40074571fa58343dd7cfe3e88ab6
tree74db91b8c7eddb006a6433395b27d2675242c284
parent81b73951f1aa081338807bdc10983dc4663938ea
Update argument names of torch::autograd::FunctionPostHook (#18140)

Summary:
They are called as (outputs, inputs) and were named (inputs, outputs).

Possible follow up fix is to make the outputs argument an lvalue to allow for calling multiple post hooks without ever copying outputs vector. It looks like the copy is now forced because the hook takes a const reference as input and returns an value. This would change the prototype of the function, so needs further discussion.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18140

Differential Revision: D14684498

Pulled By: pietern

fbshipit-source-id: 1bd3ddbdd1ff7fe0a18241de5a9ec745a4e7ef07
torch/csrc/autograd/function_hook.h