mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix clang-tidy errors in torch/csrc/distributed
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18709 Differential Revision: D14725936 Pulled By: pietern fbshipit-source-id: 307bc446d53da5d0e04d730bb51b7fb29212ace3
This commit is contained in:
committed by
Facebook Github Bot
parent
385a755b68
commit
0b6ed83f33
@ -17,7 +17,8 @@ class LambdaPostHook : public torch::autograd::FunctionPostHook {
|
||||
using variable_list = std::vector<torch::autograd::Variable>;
|
||||
|
||||
public:
|
||||
/* implicit */ LambdaPostHook(std::function<void(void)> fn) : fn_(fn) {}
|
||||
/* implicit */ LambdaPostHook(std::function<void(void)> fn)
|
||||
: fn_(std::move(fn)) {}
|
||||
|
||||
variable_list operator()(
|
||||
const variable_list& outputs,
|
||||
@ -356,7 +357,7 @@ void Reducer::prepare_for_backward(
|
||||
|
||||
// Seed queue with the grad functions of all outputs.
|
||||
for (const auto& output : outputs) {
|
||||
auto grad_fn = output.grad_fn();
|
||||
const auto& grad_fn = output.grad_fn();
|
||||
if (grad_fn) {
|
||||
queue.push_back(grad_fn.get());
|
||||
}
|
||||
|
Reference in New Issue
Block a user